[unixODBC-support] [freeTDS] linking issue

Duncan Kerr DKerr at nyx.com
Tue Apr 28 16:20:41 BST 2009


The command line should read

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/Unha\
ndledReqAdaptor.o \
/home/duncank/Projects/MCS/Data_Collator/Main/Adaptors/linux_64/Moni\
torDBAdaptor.o \
/home/duncank/Projects/MCS/Data_Collator/Main/Adaptors/linux_64/Dump\
ingBranch.o  -lDCMessages -lDCStream -lMessages_DataCollator \
-lboost_serialization-gcc41-mt -lboost_system-gcc41-mt

Duncan Kerr
NYSE Technologies 
t +44 (0)20 7655 7214

> -----Original Message-----
> From: unixodbc-support-bounces at mailman.unixodbc.org [mailto:unixodbc-
> support-bounces at mailman.unixodbc.org] On Behalf Of Duncan Kerr
> Sent: 28 April 2009 15:00
> To: unixodbc-support at mailman.unixodbc.org
> Subject: [unixODBC-support] [freeTDS] linking issue
> 
> 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
dR
> eqAdaptor.o
>
/home/duncank/Projects/MCS/Data_Collator/Main/Adaptors/linux_64/MonitorD
BA
> daptor.o
>
/home/duncank/Projects/MCS/Data_Collator/Main/Adaptors/linux_64/DumpingB
ra
> nch.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
BA
> daptor.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.
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.



More information about the unixODBC-support mailing list