[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
/home/duncank/Projects/MCS/Build/Main/lib/linux64/libDCAdaptors.so
-shared -Wl,-soname=libDCAdaptors.so
/home/duncank/Projects/MCS/Data_Collator/Main/Adaptors/linux_64/Unhandle
dReqAdaptor.o
/home/duncank/Projects/MCS/Data_Collator/Main/Adaptors/linux_64/MonitorD
BAdaptor.o
/home/duncank/Projects/MCS/Data_Collator/Main/Adaptors/linux_64/DumpingB
ranch.o  -lDCMessages -lDCStream -lMessages_DataCollator
-lboost_serialization-gcc41-mt -lboost_system-gcc41-mt

/usr/bin/ld:
/home/duncank/Projects/MCS/Data_Collator/Main/Adaptors/linux_64/MonitorD
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

 

Thanks

 

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