s_turner99
asked on
Can't find object file to complete linking...
(BTW: I'm new to Linux)
Using RedHat 6.0 (kernel 2.2.5-15), trying to compile and link a simple program using gcc. There are numerous *.h files in /usr/src/linux/include/lin ux, the one I'm working with is pci.h. The simple little test program I wrote compiles okay, but I don't know how to locate the object file (or archive) that has to be linked in to resolve references to the function prototypes in pci.h. I've used find and grep on the entire file system trying to locate a file called pci.o, or even any source code references to the same functions I'm trying to use - didn't find any. :(
Is there a document somewhere that has detailed info on system functions commonly used by device drivers?
Using RedHat 6.0 (kernel 2.2.5-15), trying to compile and link a simple program using gcc. There are numerous *.h files in /usr/src/linux/include/lin
Is there a document somewhere that has detailed info on system functions commonly used by device drivers?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks rwenzla!
The "make config" asked hundreds of questions, I answered them all (but some of them wrong, no doubt).
Anyway, the pci.o file was successfully created. Sadly, I tried to link my simple program and now there are dozens of unresolved references relating to pci.o itself! There's probably something pretty basic about linking in system functions that I'm just not getting...so look for another question for about 50 points or so very soon.
The "make config" asked hundreds of questions, I answered them all (but some of them wrong, no doubt).
Anyway, the pci.o file was successfully created. Sadly, I tried to link my simple program and now there are dozens of unresolved references relating to pci.o itself! There's probably something pretty basic about linking in system functions that I'm just not getting...so look for another question for about 50 points or so very soon.
ASKER
Oh, yes, and mpass thanks for your comments too. Using "locate" is MUCH faster than trying "find" and "grep" everywhere.
BTW: updatedb kept locking up when it encountered certain directories, what finally worked to get my database updated was "slocate -u -v -e /.automount,/.gnome_privat e,/misc,/l ost+found, /mnt,/net"
Thanks again.
BTW: updatedb kept locking up when it encountered certain directories, what finally worked to get my database updated was "slocate -u -v -e /.automount,/.gnome_privat
Thanks again.
Look in the header pci.h for all the includes.
You'll probably have to link to those .o files, too (and the ones in their .h's and so on).
pci.o is a loadable module, and probably dependant on quite a few other things. It wasn't meant to stand alone.
You'll probably have to link to those .o files, too (and the ones in their .h's and so on).
pci.o is a loadable module, and probably dependant on quite a few other things. It wasn't meant to stand alone.
ASKER
Hey rwenzla, if you can tell me exactly how to accomplish your suggestion (previous comment) then I'll give ya 100 points!
My entire problem is that manually searching for all those object files is too tedious and error-prone. I figure there's gotta be an "automatic" way that I just don't know about.
My entire problem is that manually searching for all those object files is too tedious and error-prone. I figure there's gotta be an "automatic" way that I just don't know about.
locate pci
To find all files with the string 'pci' in it.
locate .o
To find all object files on the system.
Hope this helps.