Shared library for GNU compiler GCC
Dear all,
How can I check which shared library that GNU compiler look at? And also how can I add a shared library to the compiler? Suppose my program requires stdio.h, but I don't know which version of stdio.h that the compiler looks at since there are multiple files that named stdio.h. Also if there's a library that I want to add to the shared, how can I do that? Could anybody point me to a documentation that explains this thoroughly? best regards, ethereal1m |
ethereal1m,
If I get you right: If there are multiple files, one of them is usually a Symbolic link that refers to the a real shared object. for instance if you need a shared object named sharedobj.so.3 but there are sharedobj.so.7 and sharedobj.so.9 available in the system as well, there would be a file called sharedobj.so which is a sym link that refers to one of the mentioned 3 files. You can find the mapping by "ls -l" command and if needed change it to the shared object that you need. for adding shared object to the library see: http://tldp.org/HOWTO/Program-Librar...libraries.html hope that helps |
Ok,
I was actually thinking about "include files" (like stdio.h, iostream, etc), not shared objects file. Hmmm, can we call include files shared libraries? or we just call them "include files". Include files are usually under /usr/include. And my stdio.h files are multiple in that location. How can I now which "include files" the gcc uses? Sorry for the mix up... |
Hi,
You can use the -E option to let only the preprocessor work : gcc -E myfile.c |
Quote:
The specific directories that gcc looks in for header files are defined when it is built. From the man page: Code:
CPATH |
aaa, ok, thanks you guys...
|
All times are GMT -5. The time now is 04:33 PM. |