The Bellinghman (bellinghman) wrote,
The Bellinghman
bellinghman

A question on AIX/gcc/C++

I have a problem trying to link some C++ code on AIX 5.3:



I'm trying to create a shared library on AIX, containing both the source to Perl, and some C++ code. I've got the relevant parts compiling, but I'm ending up with a link failure. This is what the output looks like. I'm obviously missing some library, but I'm rather bemused as to what, since I've never played on AIX before, and have hardly ever used gcc either.

(Yes, I'm logged in as root - so sue me. I'm running as the only user, and it's a throwaway environment.)

[pS0468C:root] /aix_gcc $ dmake
Linking Release/libJavaPerl.so
gcc -L/usr/lib/threads -shared -o Release/libJavaPerl.so -Wl,-brtl -Wl,-bdynamic -Wl,-bmaxdata:0x80000000 -Wl,-b32 -Xlinker Rel_tmp/PerlInterface.o Rel_tmp/com_episys_javaperl_Interpreter.o Rel_tmp/JavaAdaptor.o Rel_tmp/EvalReturn.o Rel_tmp/BadParameters.o Rel_tmp/Callback.o Rel_tmp/CharSetConverter.o Rel_tmp/PerlException.o Rel_tmp/JavaObjectRef.o Rel_tmp/JStringToUTF8.o Rel_tmp/StackTrace.o Rel_tmp/UTF8ToJString.o Rel_tmp/libperl.a Rel_tmp/DynaLoader.a -lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc -lbsd -lstdc++
ld: 0711-317 ERROR: Undefined symbol: vtable for __cxxabiv1::__vmi_class_type_info
ld: 0711-317 ERROR: Undefined symbol: vtable for __cxxabiv1::__class_type_info
ld: 0711-317 ERROR: Undefined symbol: vtable for __cxxabiv1::__si_class_type_info
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string
[Error: Irreparable invalid markup ('<char,>') in entry. Owner must fix manually. Raw contents below.]

I have a problem trying to link some C++ code on AIX 5.3:

<lj-cut text="definitely behind a cut">

I'm trying to create a shared library on AIX, containing both the source to Perl, and some C++ code. I've got the relevant parts compiling, but I'm ending up with a link failure. This is what the output looks like. I'm obviously missing some library, but I'm rather bemused as to what, since I've never played on AIX before, and have hardly ever used gcc either.

(Yes, I'm logged in as root - so sue me. I'm running as the only user, and it's a throwaway environment.)

[pS0468C:root] /aix_gcc $ dmake
Linking Release/libJavaPerl.so
gcc -L/usr/lib/threads -shared -o Release/libJavaPerl.so -Wl,-brtl -Wl,-bdynamic -Wl,-bmaxdata:0x80000000 -Wl,-b32 -Xlinker Rel_tmp/PerlInterface.o Rel_tmp/com_episys_javaperl_Interpreter.o Rel_tmp/JavaAdaptor.o Rel_tmp/EvalReturn.o Rel_tmp/BadParameters.o Rel_tmp/Callback.o Rel_tmp/CharSetConverter.o Rel_tmp/PerlException.o Rel_tmp/JavaObjectRef.o Rel_tmp/JStringToUTF8.o Rel_tmp/StackTrace.o Rel_tmp/UTF8ToJString.o Rel_tmp/libperl.a Rel_tmp/DynaLoader.a -lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc -lbsd -lstdc++
ld: 0711-317 ERROR: Undefined symbol: vtable for __cxxabiv1::__vmi_class_type_info
ld: 0711-317 ERROR: Undefined symbol: vtable for __cxxabiv1::__class_type_info
ld: 0711-317 ERROR: Undefined symbol: vtable for __cxxabiv1::__si_class_type_info
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::~basic_string()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::operator=(std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> > const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> > const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::basic_string()
ld: 0711-317 ERROR: Undefined symbol: .std::allocator<char>::allocator()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_istringstream<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::basic_istringstream(std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> > const&, std::_Ios_Openmode)
ld: 0711-317 ERROR: Undefined symbol: .std::allocator<char>::~allocator()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_istream<char, std::char_traits<char="std::char_traits&lt;char"> >::operator>>(void*&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_istringstream<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::~basic_istringstream()
ld: 0711-317 ERROR: Undefined symbol: typeinfo for std::exception
ld: 0711-317 ERROR: Undefined symbol: vtable for std::exception
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::c_str() const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> > const&) const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::size() const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::append(std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> > const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::append(char const*)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::operator+=(char const*)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::find(std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> > const&, unsigned long) const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::erase(unsigned long, unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::begin()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::operator[](unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::operator=(char const*)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostringstream<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream<char, std::char_traits<char="std::char_traits&lt;char"> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char="std::char_traits&lt;char"> >&, char const*)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream<char, std::char_traits<char="std::char_traits&lt;char"> >::operator<<(void const*)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostringstream<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::str() const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostringstream<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::~basic_ostringstream()
ld: 0711-317 ERROR: Undefined symbol: .std::allocator<wchar_t>::allocator()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::basic_string(unsigned long, wchar_t, std::allocator<wchar_t> const&)
ld: 0711-317 ERROR: Undefined symbol: .std::allocator<wchar_t>::~allocator()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::operator[](unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::operator[](unsigned long) const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::~basic_string()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::size() const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::basic_string(unsigned long, char, std::allocator<char> const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::operator[](unsigned long) const
ld: 0711-317 ERROR: Undefined symbol: .std::basic_ostream<char, std::char_traits<char="std::char_traits&lt;char"> >& std::operator<< <char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char="std::char_traits&lt;char"> >&, std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> > const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::c_str() const
ld: 0711-317 ERROR: Undefined symbol: .std::allocator<wchar_t>::~allocator()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::_S_empty_rep()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::_Rep::_M_refdata()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::_Rep::_S_create(unsigned long, unsigned long, std::allocator<wchar_t> const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::_Rep::_M_set_length_and_sharable(unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::_Alloc_hider::_Alloc_hider(wchar_t*, std::allocator<wchar_t> const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<wchar_t, std::char_traits<wchar_t="std::char_traits&lt;wchar_t">, std::allocator<wchar_t> >::basic_string()
ld: 0711-317 ERROR: Undefined symbol: .std::allocator<char>::~allocator()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::_S_empty_rep()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::_Rep::_M_refdata()
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::_S_copy_chars(char*, char const*, char const*)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::_Rep::_M_set_length_and_sharable(unsigned long)
ld: 0711-317 ERROR: Undefined symbol: .std::basic_string<char, std::char_traits<char="std::char_traits&lt;char">, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, std::allocator<char> const&)
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
dmake: Error code 1, while making 'Release/libJavaPerl.so'


[pS0468C:root] /aix_gcc $ gcc --v
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.3.0.0
Thread model: aix
gcc version 4.0.0

</lj-cut>

Any clues?
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 10 comments