Linking problems with scons

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
alarionfirn
Posts: 0
Joined: Sun Nov 27, 2005 11:04 am

Linking problems with scons

Post by alarionfirn » Sun Jun 17, 2007 10:59 am

I'm under windows and using MinGW with scons to compile blender. However when linking blender.exe I'm getting tons of undefined reference errors.

Linking program ==> 'blender.exe'
=====
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0xbe): undefined reference to `__gxx_personality_sj0'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0xe7): undefined reference to `operator new(unsigned int)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x132): undefined reference to `operator delete(void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x1bb): undefined reference to `__gxx_personality_sj0'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x279): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x29c): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x67e): undefined reference to `__gxx_personality_sj0'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x6a7): undefined reference to `operator new(unsigned int)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x6e8): undefined reference to `operator delete(void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x891): undefined reference to `__gxx_personality_sj0'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x95a): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x964): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x974): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x97e): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0xe3c): undefined reference to `std::ios_base::Init::Init()'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0xe58): undefined reference to `std::ios_base::Init::~Init()'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x16f): undefined reference to `operator delete(void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_SoundObject.o):SND_SoundObject.cpp:(.text+0x12): undefined reference to `__gxx_personality_sj0'

....etc.

collect2: ld returned 1 exit status

=====
scons: building terminated because of errors.

Does anybody know what causes this problem?

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Sun Jun 17, 2007 11:14 am

Looks like the stdc++ library is missing. Check your mingw install and also check if you accidently changed the win32-mingw-config.py

/Nathan

alarionfirn
Posts: 0
Joined: Sun Nov 27, 2005 11:04 am

Post by alarionfirn » Sun Jun 17, 2007 12:17 pm

I have the stdc++ library and I checked that I didn't change win32-mingw-config.py. Everything seems to be fine.
Thanks for your quick reply though :) .

harkyman
Posts: 98
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA
Contact:

Post by harkyman » Fri Jun 29, 2007 4:23 am

This is where I'm at as well. Exact same problem. Smooth compile until that final linking stage. :cry: I also have the mentioned lib sitting quite happily in mingw.

Scons .97 and .96 -- both give the same result.

gcc and g++ 3.4.2 (mingw-special), which others on IRC have reported success with.

Windows XP.

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Sat Jun 30, 2007 12:09 pm

Set LLIBS in your user-config.py to include stdc++ as follows:

LLIBS = ['-lshell32', '-lshfolder', '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++']

/Nathan

scabootssca
Posts: 0
Joined: Fri Jun 02, 2006 7:10 am

Post by scabootssca » Sun Jul 01, 2007 8:55 am

oh cool thank you jesterKing, i had the exact same error and couldnt get blender to compile and now it's working, so thanks alot

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Sun Jul 01, 2007 10:51 am

Since this has for some reason popped up lately I'll commit this addition to the default settings for mingw.

/Nathan

jesterKing
Site Admin
Posts: 207
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Sun Jul 01, 2007 11:06 am

Done.

/Nathan

ChristianDobryvechir
Posts: 0
Joined: Mon Mar 01, 2010 2:28 pm
Location: Ukraine

Re: Linking problems with scons

Post by ChristianDobryvechir » Mon Mar 01, 2010 2:36 pm

[quote="alarionfirn"]I'm under windows and using MinGW with scons to compile blender. However when linking blender.exe I'm getting tons of undefined reference errors.

Linking program ==> 'blender.exe'
=====
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0xbe): undefined reference to `__gxx_personality_sj0'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0xe7): undefined reference to `operator new(unsigned int)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x132): undefined reference to `operator delete(void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x1bb): undefined reference to `__gxx_personality_sj0'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x279): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x29c): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x67e): undefined reference to `__gxx_personality_sj0'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x6a7): undefined reference to `operator new(unsigned int)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x6e8): undefined reference to `operator delete(void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x891): undefined reference to `__gxx_personality_sj0'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x95a): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x964): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x974): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x97e): undefined reference to `operator delete[](void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0xe3c): undefined reference to `std::ios_base::Init::Init()'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0xe58): undefined reference to `std::ios_base::Init::~Init()'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_C-api.o):SND_C-api.cpp:(.text+0x16f): undefined reference to `operator delete(void*)'
C:\blenderdev\trunk\build\win32-mingw\lib\libbf_soundsystem.a(SND_SoundObject.o):SND_SoundObject.cpp:(.text+0x12): undefined reference to `__gxx_personality_sj0'

....etc.

collect2: ld returned 1 exit status

=====
scons: building terminated because of errors.
The problem is in linking standard libraries, however, if you use g++ instead of gcc you will not have these problems.

May God give you wisdom!
Christian Volodymyr Dobryvechir (dobrivecher at yahoo com)

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Mon Mar 01, 2010 4:04 pm

May God give you the wisdom to not reply to 3 year old posts.

He might further note the problem referred to was a missing libstdc++, not the wrong compiler.

Post Reply