I'm attempting to compile a program in linux using C. my linux version is 22.214.171.124-686
This is the command I am using to compile:
gcc test2.c /usr/local/lib/libtdsodbc.a
As you can see I have a library in /usr/local/lib that this program requires. I do not have my instance set up to look in there automatically so I have to tell it to find the library there. This works part way, but then one of the functions invoked within the library itself seems to then run into a similar problem, I get this error:
test2.c: In function âmainâ:
test2.c:18: warning: incompatible implicit declaration of built-in function âmallocâ
/usr/local/lib/libtdsodbc.a(connectparams.o): In function `myGetPrivateProfileString':
/home/username/freetds-0.92.dev.20110819/src/odbc/connectparams.c:143: undefined reference to `SQLGetPrivateProfileString'
collect2: ld returned 1 exit status
The function it is trying to find is infact within the very library I am already telling it where to find. So in some round about way, something invoked by code related to the libraries I'm including are trying to then look at libraries that it can not find, as demonstrated by this grep:
grep SQLGetPrivateProfileString /usr/local/lib/*.*
Binary file /usr/local/lib/libodbcinst.so matches
Binary file /usr/local/lib/libodbcinst.so.1 matches
Binary file /usr/local/lib/libodbcinst.so.1.0.0 matches
Binary file /usr/local/lib/libodbc.so matches
Binary file /usr/local/lib/libodbc.so.1 matches
Binary file /usr/local/lib/libodbc.so.1.0.0 matches
Binary file /usr/local/lib/libtdsodbc.a matches
Binary file /usr/local/lib/libtdsodbc.so matches
Binary file /usr/local/lib/libtdsodbc.so.0 matches
Binary file /usr/local/lib/libtdsodbc.so.0.0.0 matches
As you can see, the function is in libtdsodbc.a, which I'm already pointing it to.
I need to know how to make this program compile. I assume this is an issue with proper library paths.