accesssing parallel port error
hi to all
I want to access parallel port using fedora core 4 and gcc 4.0.0 . In window operating system we use dos.h for accessing parallel port but gcc compiler show error for this file.please tell me what header file i should use for this purpose also tell me how can i get complete information about using gcc compiler and how can i check header files for its functions,is there any gui interface available for gcc compiler. thanks |
As i know you can access nearly any hardware only by using appropriate device files (located under /dev). Find out what is your port's file and try to simply write to it.
|
Method 1: Look in /dev for anything with lpn, where n is a digit, e.g.
Code:
/dev/lp0 Method 2: Check in dmesg: Code:
dmesg |grep parport |grep ' lp' Method3: Have a poke about in the /proc and /sys filesystems. I'm not quite sure how to get the device filename from this, but it's possible to get the IO base address and such. |
I assume that you are wanting to program the parallel port and not just attach a printer.
http://parapin.sourceforge.net/ http://tldp.org/HOWTO/IO-Port-Programming.html |
Quote:
Code:
#include <stdio.h> port.cpp: In function `int main()': port.cpp:18: error: `ioperm' undeclared (first use this function) port.cpp:18: error: (Each undeclared identifier is reported only once for each function it appears in.) port.cpp:18: error: `exit' undeclared (first use this function) Is there something that I missed? I hope someone can help me out, since I really need to do a the parallel port interfacing program in c++. Thank you in advance. |
All times are GMT -5. The time now is 02:05 AM. |