[unixODBC-support] [freeTDS] linking issue

Duncan Kerr DKerr at nyx.com
Tue Apr 28 15:00:05 BST 2009

I am struggling to create a shared library with freeTDS lib calls in it.
I can create an executable which is linked with libTDS.a.  However, when
I try and put the same object files into a shared library, I get errors
like the one below.


I have tried to build and link all objects with -fPIC on the command
line - which doesn't fix the problem


g++ -g -O2 -fPIC -Wall -fmessage-length=0
-L/home/duncank/Projects/MCS/Build/Main/lib/linux64 -Wl,-rpath
/home/duncank/Projects/MCS/Build/Main/lib/linux64 -L/opt/boost/lib
-Wl,-rpath /opt/boost/lib
-L/home/duncank/freetds-0.83.dev.20090313/src/tds/.libs -o
-shared -Wl,-soname=libDCAdaptors.so
ranch.o  -lDCMessages -lDCStream -lMessages_DataCollator
-lboost_serialization-gcc41-mt -lboost_system-gcc41-mt

BAdaptor.o: relocation R_X86_64_PC32 against `tds_submit_query' can not
be used when making a shared object; recompile with -fPIC

/usr/bin/ld: final link failed: Bad value

collect2: ld returned 1 exit status




Duncan Kerr

NYSE Technologies 

t +44 (0)20 7655 7214


This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20090428/a00023ed/attachment.html>

More information about the unixODBC-support mailing list