I have a problem here that I can't quite explain. The linker is complaining that a symbol from the Oracle client libraries is undefined:
$ gcc-4.6 -L/usr/local/oracle/product/11.2.0/dbhome_1/lib -lcurl -m64 -lpthread -lclntsh advarc.o wintbx.a winlib_o.a -o advarc
advarc.o: In function `main':
advarc.c:(.text+0x1c68): undefined reference to `sqlcxt'
advarc.c:(.text+0x1f19): undefined reference to `sqlcxt'
advarc.c:(.text+0x1fb3): undefined reference to `sqlcxt'
advarc.c:(.text+0x21cc): undefined reference to `sqlcxt'
advarc.c:(.text+0x25f9): undefined reference to `sqlcxt'
advarc.o:advarc.c:(.text+0x2693): more undefined references to `sqlcxt' follow
wintbx.a(stlthread.o): In function `initialiseThread':
stlthread.c:(.text+0x70): undefined reference to `pthread_setconcurrency'
stlthread.c:(.text+0x8a): undefined reference to `pthread_create'
winlib_o.a(winlib_o.o): In function `dbconnect':
winlib_o.c:(.text+0x8f6): undefined reference to `sqlcxt'
winlib_o.c:(.text+0xa39): undefined reference to `sqlcxt'
winlib_o.a(winlib_o.o): In function `dbdisconnect':
winlib_o.c:(.text+0xb03): undefined reference to `sqlcxt'
winlib_o.a(winlib_o.o): In function `dbdynamic':
winlib_o.c:(.text+0xd44): undefined reference to `sqlcxt'
winlib_o.c:(.text+0xef3): undefined reference to `sqlcxt'
winlib_o.a(winlib_o.o):winlib_o.c:(.text+0xf89): more undefined references to `sqlcxt' follow
collect2: ld returned 1 exit status
But according to nm, the symbol is defined:
nm /usr/local/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so | grep sqlcxt
0000000001d154f0 T sqlcxt
I was able to build and run the same code up to (and including) Ubuntu 11.04. The libclntsh library has been re-linked against the new system libraries.