aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Tarball compilation fails since 2008010x  (Read 3381 times)

chemical

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
Tarball compilation fails since 2008010x
« on: February 11, 2008, 12:13:56 PM »

Hi, while compiling 2008-01-01 worked and still works, since 2008-01-0x (don't know the exact day) compilation fails with undefined references.

I updated after this GCC 4.0.3 to 4.2.2, but still experience the same problem.

Code: [Select]
g++  -isystem /usr/include -D__CRYPTO_INSTALLED__ -D__WEAK_CRYPTO__  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS  -L/usr/lib  -lpthread -o ed2k  ed2k-ED2KLinkParser.o ed2k-MagnetURI.o ed2k-MuleCollection.o   -lz
ed2k-ED2KLinkParser.o: In function `getVersion()':
ED2KLinkParser.cpp:(.text+0x49c): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0x517): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0x56a): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0x625): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0x6bc): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0x6d0): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0x6df): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0x757): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0x826): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0x83d): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0x866): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0x8c1): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0x8ef): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0x941): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ed2k-ED2KLinkParser.o: In function `badLink(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ED2KLinkParser.cpp:(.text+0x9a4): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
ED2KLinkParser.cpp:(.text+0x9b7): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
ED2KLinkParser.cpp:(.text+0x9ef): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
ED2KLinkParser.cpp:(.text+0x9fd): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0xa41): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0xa4b): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0xa99): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ed2k-ED2KLinkParser.o: In function `checkServerListLink(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ED2KLinkParser.cpp:(.text+0xafb): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0xbd3): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0xbe6): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0xbfe): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ED2KLinkParser.cpp:(.text+0xc88): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
ed2k-ED2KLinkParser.o:ED2KLinkParser.cpp:(.text+0xc9b): more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage' follow
ed2k-ED2KLinkParser.o: In function `checkServerListLink(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ED2KLinkParser.cpp:(.text+0xd2a): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0xdd5): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0xdec): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0xe00): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ED2KLinkParser.cpp:(.text+0xe17): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ed2k-ED2KLinkParser.o:ED2KLinkParser.cpp:(.text+0xe2e): more undefined references to `__gnu_cxx::__exchange_and_add(int volatile*, int)' follow
ed2k-ED2KLinkParser.o: In function `checkServerListLink(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ED2KLinkParser.cpp:(.text+0xe3f): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
[...]
MuleCollection.cpp:(.text._ZNSt6vectorI14CollectionFileSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<CollectionFile, std::allocator<CollectionFile> >::_M_insert_aux(__gnu_cxx::__normal_iterator<CollectionFile*, std::vector<CollectionFile, std::allocator<CollectionFile> > >, CollectionFile const&)]+0x3c3): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
MuleCollection.cpp:(.text._ZNSt6vectorI14CollectionFileSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<CollectionFile, std::allocator<CollectionFile> >::_M_insert_aux(__gnu_cxx::__normal_iterator<CollectionFile*, std::vector<CollectionFile, std::allocator<CollectionFile> > >, CollectionFile const&)]+0x480): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
MuleCollection.cpp:(.text._ZNSt6vectorI14CollectionFileSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<CollectionFile, std::allocator<CollectionFile> >::_M_insert_aux(__gnu_cxx::__normal_iterator<CollectionFile*, std::vector<CollectionFile, std::allocator<CollectionFile> > >, CollectionFile const&)]+0x4ea): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
ed2k-MuleCollection.o: In function `void std::__uninitialized_fill_n_aux<CollectionFile*, unsigned int, CollectionFile>(CollectionFile*, unsigned int, CollectionFile const&, std::__false_type)':
MuleCollection.cpp:(.text._ZSt26__uninitialized_fill_n_auxIP14CollectionFilejS0_EvT_T0_RKT1_St12__false_type[void std::__uninitialized_fill_n_aux<CollectionFile*, unsigned int, CollectionFile>(CollectionFile*, unsigned int, CollectionFile const&, std::__false_type)]+0x83): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
MuleCollection.cpp:(.text._ZSt26__uninitialized_fill_n_auxIP14CollectionFilejS0_EvT_T0_RKT1_St12__false_type[void std::__uninitialized_fill_n_aux<CollectionFile*, unsigned int, CollectionFile>(CollectionFile*, unsigned int, CollectionFile const&, std::__false_type)]+0xf0): undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
collect2: ld returned 1 exit status
make[3]: *** [ed2k] Error 1
make[3]: Leaving directory `/home/donkey/amule/amule-cvs-20080210/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/donkey/amule/amule-cvs-20080210/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/donkey/amule/amule-cvs-20080210'
make: *** [all] Error 2
donkey@prime:~/amule/amule-cvs-20080210>

Damn, why are c++ errors so text intensive. Anyways, I use these toolkits:
Code: [Select]
./configure --prefix=$HOME/amule/build --enable-optimize --disable-debug --enable-amule-daemon --enable-amulecmd --enable-webserver --enable-amule-gui --enable-wxcas --enable-cas --disable-upnp
Which results in:
Code: [Select]
  Configure script has finished system check.

  Configured aMule SVN for 'i686-pc-linux-gnu'.

  aMule enabled options:

  **** aMule Core ****
  Prefix where aMule should be installed?                    /home/donkey/amule/build
  Should aMule be compiled with i18n support?                yes
  Should aMule be compiled in debug mode?                    no
  Should aMule be compiled with profiling?                   no
  Should aMule be compiled with optimizations?               yes
  Should aMule be compiled with UPnP support?                no
  Should aMule be compiled with IP2country support?          no
  Should aMule monolithic application be built?              yes
  Should aMule daemon version be built?                      yes
  Should aMule remote gui be built? (EXPERIMENTAL)           yes
  Crypto++ library/headers style?                            installed

  **** aMule TextClient ****
  Should aMule Command Line Client be built?                 yes

  **** aMule WebServer ****
  Should aMule WebServer be built?                           yes

  **** aMule ED2K Links Handler ****
  Should aMule ED2K Links Handler be built?                  yes

  **** aMuleLinkCreator ****
  Should aMuleLinkCreator GUI version (alc) be built?        no
  Should aMuleLinkCreator for console (alcc) be built?       no

  **** aMule Statistics ****
  Should C aMule Statistics (CAS) be built?                  yes
  Should aMule GUI Statistics (wxCas) be built?              yes

  **** General Libraries and Tools ****
  Should ccache support be enabled?                          no
  Libraries aMule will use to build:
                                       wxWidgets             2.8.7 (gtk2,shared)
                                       crypto++              5.5.2 (installed)
                                       libpng                1.2.24
                                       libgd                 2.0.35
                                       zlib                  1.2.3
donkey@prime:~/amule/amule-cvs-20080210>

Does anyone have an idea? Like I said, 20080101 worked and still works.


« Last Edit: February 11, 2008, 12:23:48 PM by chemical »
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: Tarball compilation failed since 2008010x
« Reply #1 on: February 11, 2008, 12:40:49 PM »

I just compiled with your command line and it worked on my PC. (Archlinux; gcc 4.2.3) Could you please tell us what distribution you are using?
Logged

chemical

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
Re: Tarball compilation fails since 2008010x
« Reply #2 on: February 11, 2008, 12:58:53 PM »

This perhaps is the problem. My base system is rather old (SuSE 9.0), but most the libraries including the kernel are up to date. In the home of my user all needed libs are installed with --prefix=$HOME, so they are easily updated without disturbing the rest of the system.

Maybe, since that date 2008010x, there is a new dependency which I don't have updated now. Xaignar pointed me to the STL library, but I don't know how to check which files should have which versions.

Do you know which files (I guess the problem is in /usr/include here) are read while using the command pasted above?

Thanks.

EDIT: Is there a neat way to configure this path to $HOME/include? I believe that it references to the header files of the wrong compiler (SuSE 9.0 uses 3.3.1)
« Last Edit: February 11, 2008, 01:09:40 PM by chemical »
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: Tarball compilation fails since 2008010x
« Reply #3 on: February 11, 2008, 01:15:08 PM »

Are there any reasons for using such a rather messy set-up? I mean no offence, but it would most probably be a lot easier to use a coherent system than trying to mess with a more than 4 year old distribution. (Suse 9.0 was released in 2003, IIRC)

That being said, there haven't been any direct changes to the MuleCollection class after January 1st. I wish we had public SVN access, but I'll try to dig a bit deeper in the commits from January, maybe I'll find something which might have caused this.
Logged

chemical

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
Re: Tarball compilation fails since 2008010x
« Reply #4 on: February 11, 2008, 01:32:10 PM »

Yes, you're perfectly right. I keep on postponing the project to upgrade my router from SuSE to debian; theres so much work in customizing, migrating and learning to do it "the-debian-way" ... it would take days full of work. But you're right, I should consider doing this step sometime soon.

But its not messy - its just that the user donkey has everything that is needed to compile in his homedirectory. This worked quite well until 2008010x.

I just diffed ED2KLinkParser.cpp between 20080101 and 20080211 and there is only a change in the comments of that file.

I guess for now I need to find a way to include the other dir ...
Anyway, thanks for your efforts.
« Last Edit: February 11, 2008, 01:33:41 PM by chemical »
Logged

chemical

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
Re: Tarball compilation fails since 2008010x
« Reply #5 on: February 11, 2008, 02:14:10 PM »

I found a solution.

Original command:
Code: [Select]
g++  -isystem /usr/include -D__CRYPTO_INSTALLED__ -D__WEAK_CRYPTO__  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS  -L/usr/lib  -lpthread -o ed2k  ed2k-ED2KLinkParser.o ed2k-MagnetURI.o ed2k-MuleCollection.o   -lz
If I change -L/usr/lib to -L$HOME/lib, it works. Obviously configure does something different in recent tarballs.

This is the command of the 20080101 tarball:
Code: [Select]
g++  -DUSE_EMBEDDED_CRYPTO  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS  -lpthread -o ed2k  ed2k-ED2KLinkParser.o ed2k-MagnetURI.o ed2k-MuleCollection.o   -lz
There is no -L at all, maybe because Crypto++ was embedded.
Logged

chemical

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 61
Re: Tarball compilation fails since 2008010x
« Reply #6 on: February 11, 2008, 03:24:11 PM »

Ok, I guess I pinned the problem now.

I installed crypto++ systemwide in /usr/lib, and thats why CRYPTO_PP_PATH is set to that dir, causes the g++ to find different libs and include/header files for that single statement.

I'll reinstall crypto++ to --prefix=$HOME (hope thats easy) and that should do the trick.

Thanks wuischke for pointing me into the right direction.
Logged