[C++-SIG] Re: Problems building and testing CXX demo

Geoffrey Furnish furnish at actel.com
Tue May 9 17:18:04 CEST 2000

Steve Harris writes:
 > Phil Austin <phil at geog.ubc.ca> writes:
 > > KCC  python.o -o mypython  -L/nfs/brant/local1/lib/python/solaris/lib/python1.5/config \
 > >           -lpython1.5 -lm -lnsl -lsocket -ldl ./libcxx.so
 > In my case, I translate this to look like:
 > > g++ python.o -o mypython -L ~/usr/local/lib/python1.5/config \
 >   -lpython1.5 -lm -lnsl -lsocket -ldl ./libcxx.so
 > Undefined                       first referenced
 >  symbol                             in file
 > in                                  ./libcxx.so
 > ld: fatal: Symbol referencing errors. No output written to mypython
 > collect2: ld returned 1 exit status
 > Note that there's a symbol "in" that's missing. I can use 'nm' to
 > isolate that symbol:
 > > nm ./libcxx.so | egrep '\|in$'
 > [873]   |         0|       0|NOTY |GLOB |0    |UNDEF  |in
 > At this point, I'm stumped. I can't find any such variable in the
 > code. Any ideas what this could mean?

It looks to me like just a small problem with the invocation of the
loader.  The KCC driver script may be able to notice that you've
provided a library without using a library introducer token (-l), and
perhaps g++ just isn't grokiing that in the version you're using.

Try changing your g++ invocation line to:

g++ python.o -o mypython -L ~/usr/local/lib/python1.5/config \
  -lpython1.5 -lm -lnsl -lsocket -ldl -L. -lcxx

Geoffrey Furnish            Actel Corporation        furnish at actel.com
Senior Staff Engineer      955 East Arques Ave       voice: 408-522-7528
Placement & Routing     Sunnyvale, CA   94086-4533   fax:   408-522-8041

"... because only those who write the code truly control the project."
						      -- Jamie Zawinski

More information about the Cplusplus-sig mailing list