xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Bertoni <dbert...@apache.org>
Subject Re: Problems linking to Xerces-C++ 2.8.0
Date Thu, 10 Sep 2009 20:31:46 GMT
Tovrea, George W (US SSA) wrote:
> ## --------- ##
> ## Platform. ##
> ## --------- ##
> 
> hostname = siamese
> uname -m = sun4u
> uname -r = 5.10
> uname -s = SunOS
> uname -v = Generic_118833-33
> 
> /usr/bin/uname -p = sparc
> /bin/uname -X     = System = SunOS
> Node = siamese
> Release = 5.10
> KernelID = Generic_118833-33
> Machine = sun4u
> BusType = <unknown>
> Serial = <unknown>
> Users = <unknown>
> OEM# = 0
> Origin# = 1
> NumCPU = 1
> 
> /bin/arch              = sun4
> /usr/bin/arch -k       = sun4u
> /
> 
> Compile:
> 
> tovrea@siamese%printenv CXX
> /net/whistler/auto/users/tovrea/local/sol2/bin/g++
> tovrea@siamese%env | grep FLAGS
> CPPFLAGS=-I/net/whistler/auto/users/tovrea/local/sol2/include
> LDFLAGS=-L/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0
> tovrea@siamese%setenv LDFLAGS "-L/net/whistler/auto/users/tovrea/local/sol2/lib -L/net/whistler/auto/users/tovrea/local/sol2/lib/gcc/sparc-sun-solaris2.10/4.4.0"
> 
> Error:
> 
> tovrea@siamese%$CXX -o ffmeta ffmeta_main.cc -D__STDC_CONSTANT_MACROS -B{HOME}/local/sol2/bin
$CPPFLAGS $LDFLAGS -lavformat -lavcodec -lavutil -lx264 -lpthread -lbz2 -lz -lxerces-c
> /net/whistler/auto/users/tovrea/local/sol2/lib/libxerces-c.so: undefined reference to
`write@SUNW_0.9'
> /net/whistler/auto/users/tovrea/local/sol2/lib/libxerces-c.so: undefined reference to
`open@SUNW_0.9'
> /net/whistler/auto/users/tovrea/local/sol2/lib/libxerces-c.so: undefined reference to
`pthread_equal@SUNW_0.9'
> /net/whistler/auto/users/tovrea/local/sol2/lib/libxerces-c.so: undefined reference to
`close@SUNW_0.9'
> /net/whistler/auto/users/tovrea/local/sol2/lib/libxerces-c.so: undefined reference to
`read@SUNW_0.9'
> /net/whistler/auto/users/tovrea/local/sol2/lib/libxerces-c.so: undefined reference to
`pthread_self@SUNW_0.9'
> collect2: ld returned 1 exit status
A quick Google search suggest you're linking the pthread and c libraries 
in the wrong order. What happens if you use the -pthread command line 
switch, instead of linking explicitly with libpthread?

In general, it's a bad idea to explicitly link with compiler/system 
libraries with GCC.  Instead, you should let the compiler select the 
correct libraries based on the command line switches you provided.

Dave

Mime
View raw message