[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shared object skips exporting some functions varaibles to give unres
From: |
Nilesh |
Subject: |
Re: shared object skips exporting some functions varaibles to give unresolved symbols while using it in exe |
Date: |
13 Sep 2006 23:48:33 -0700 |
User-agent: |
G2/1.0 |
Paul Pluzhnikov wrote:
> "Nilesh" <nileshg@gmail.com> writes:
>
> > I am facing problem in using a so inan EXE . I created the so.
> > Versions: g++ 4.4.1 on AIX 5.2 system.
>
> Wow! Current gcc development version is 4.2.
> Can I borrow your time machine?
Correction its 4.1.1.
>
> > The EXE is using it like this:
> > g++ -o EXENAME -O3 -v -L/usr/lib/threads -L/usr/local/lib -L/usr/lib
> > -L./../../libs/aix -lstdc++ -lgcc -lgcc_eh -liiapi -lm -lnsl -lpthread
> > -lc -Wl,-blibpath:/home/ngujarat/work/BiiF/libs/aix -Wl,-brtl -liif
> > ../src/THIRDPARTYEMSReceiver.o ../src/BiiMain.o
>
> That command line is completely backwards: archive libraries are
> supposed to follow objects on the link line, not preceed them.
>
> This doesn't matter much on AIX, but will break on any other UNIX.
>
> > But EXE compilation fails with "ld: 0711-317 ERROR: Undefined symbol:"
> > Errors for some constructors. Destructors, static data members in a
> > class. Perhaps these are not referenced directly in course code.
>
> You've omitted the most important part of the message -- precisely
> which symbols are undefined.
The symbols are constructors and destructors, static variables, or
abstract classes. The symbols are the C++ classes, some
std::char_traits. Like:
ld: 0711-317 ERROR: Undefined symbol:
.BMCIIF_Logger::log(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, int)
ld: 0711-317 ERROR: Undefined symbol: typeinfo for
BMCIIF_DefaultTPEMSEvent
ld: 0711-317 ERROR: Undefined symbol:
BMCIIF_DefaultDispatcher::m_objOtherEMSNewDispatchedEventsCount
ld: 0711-317 ERROR: Undefined symbol:
.BMCIIF_Statistics::operator++(int)
ld: 0711-317 ERROR: Undefined symbol:
.BMCIIF_DefaultDispatcher::log(std::basic_st
>
> > NOTE: I ran "nm" on libiif.so for Undefined symbols and they are not
> > found in the SO.
>
> Are they supposed to be found there?
Yes since they are not found the exe linking fails.
>
> > WHY Is this happening?
>
> Because you are doing something wrong, and because AIX is PITA to
> work with when using GNU tools.
>
> > Anything wrong in building SO or wrong use of SO? Flags missing?
>
> We can't tell since you didn't tell us enough details.
>
> Cheers,
> --
> In order to understand recursion you must first understand recursion.
> Remove /-nsp/ for email.