Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NIC card error with gcc command

Status
Not open for further replies.

hookem1994

Technical User
Mar 28, 2001
15
US
I am trying to install a new NIC card on Redhat 7.1 server.
When I run the compile file/script I receive an error tha tthe rtl8139.o fiel has not been found. I am attaching the compile script and the errors that I get.

Thanks in advance,
David

Here is the executible compile file I have:

gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c rtl8139.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`
if [ ! -x /usr/src/linux/modules ]
then
mkdir /usr/src/linux/modules
fi
cp ./rtl8139.o /usr/src/linux/modules/rtl8139.o

Here are the errors I recieved:

In file included from rtl8139.c:70:
/usr/include/linux/modversions.h:1:2: #error Modules should never use kernel-headers system headers,
/usr/include/linux/modversions.h:2:2: #error but headers from an appropriate kernel-source
mkdir: cannot create directory `/usr/src/linux/modules': No such file or directory
cp: cannot stat `./rtl8139.o': No such file or directory
 
Hi,

there are several points to mention, first is that GCC creates the output file with a default name of &quot;a.out&quot;, when not given the option &quot;-o <FILENAME>&quot;. So you probably should use the command:
Code:
gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c rtl8139.c -o rtl8139.o
. Don't you have a vendor-supplied Makefile for that?

Next thing is that you probably use the wrong directory to store your kernel-modules. As far as i know, the modules are searched for under &quot;
Code:
/lib/modules/<Kernel-Version>
&quot;, there should be a subdirectory &quot;net&quot; for the given NIC-module. Again, that should be done by a simple &quot;make install&quot;, using the right Makefile.

HTH,
mbr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top