I am using gentoo and trying to compile a program to control the bits on the parallel port. It has this line near the top of it:
#include <asm/io.h>
And when I try to use gcc on it, it produces this output:
port.c:4:20: error: asm/io.h: No such file or directory
"locate asm/io.h" yeilds (among other things):
/usr/src/linux-2.6.32-gentoo/arch/x86/include/asm/io.h
So I have the header file, but it's not finding it? Why is this not working?
Use double quotation marks (“”) around a direct quote. A direct quote is a word- for-word report of what someone else said or wrote. You use the exact words and punctuation of the original. Harriet Jacobs writes, “She sat down, quivering in every limb” (61).
The primary function of quotation marks is to set off and represent exact language (either spoken or written) that has come from somebody else. The quotation mark is also used to designate speech acts in fiction and sometimes poetry.
Quotation marks can be double ("...") or single ('...') - that is really a matter of style (but see below for more about this). Quotation marks are also called "quotes" or "inverted commas".
General Usage Rules In America, Canada, Australia and New Zealand, the general rule is that double quotes are used to denote direct speech. Single quotes are used to enclose a quote within a quote, a quote within a headline, or a title within a quote.
I am not sure if you are the author of the program or you're just trying to compile a program you got from someone, but looks like #include <asm/io.h>
should be replaced with #include <sys/io.h>
. See the results of this google search for more information.
Never use the code/headers in /usr/include/asm
. Use the headers in /usr/include/sys
instead.
What you are doing by using /usr/include/asm/
is building your code against a specific revision of the Kernel headers. This is subject to breakage when the kernel headers change. By linking to the other location, you will link to a more stable form of the headers in glibc, which will refer to the kernel headers as needed. That's why there's a large complex of #ifdef ... #endif
lines peppered all in the headers.
Trust me, all the tools you need for bit-fiddling with the parallel ports will be in /usr/include/sys/io.h
, since probably all you're going to be using are direct readb()
and writeb()
calls to the appropriate /dev/lpX
device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With