Scons linking fails

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
wizzleteet
Posts: 5
Joined: Fri Dec 27, 2002 5:15 pm

Scons linking fails

Post by wizzleteet » Mon Mar 27, 2006 2:21 pm

Hi All,
fresh new debian install, got all depencies installed, scons is building and fails at linking:
This happens with the CVS tree as well as the LOX build source tarball
Linking program ==> 'blender'
/usr/src/build/linux2/lib/libbf_soundsystem.a(SND_OpenALDevice.o): In function `SND_OpenALDevice::LoadSample(STR_String const&, void*, int)':SND_OpenALDevice.cpp:(.text+0x4ca): undefined reference to `alutLoadWAVMemory'
:SND_OpenALDevice.cpp:(.text+0x565): undefined reference to `alutUnloadWAV'
:SND_OpenALDevice.cpp:(.text+0x5d2): undefined reference to `alutLoadWAVFile'
collect2: ld returned 1 exit status
scons: *** [/usr/src/build/linux2/bin/blender] Error 1
scons: building terminated because of errors.
dev packages of alut and openal are installed,
Obviously it looks like an openal problem with the libs, but frankly, I haven't got a clue.

help appreciated,

wzzl

Papulizer
Posts: 0
Joined: Sat Apr 22, 2006 4:25 pm

Post by Papulizer » Sat Apr 22, 2006 4:30 pm

add "alut" to your blender/config/___.py:

BF_OPENAL_LIB = 'openal alut'

lcol8548
Posts: 0
Joined: Thu Jun 15, 2006 4:43 pm

blender compile issues

Post by lcol8548 » Thu Jun 15, 2006 4:50 pm

I have a similar error to above after 'make'. Trying to install blender on linux. Overcome several hurdles but this one has stumped me. Part of code is below....

2.4.a -L/usr/local/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi -lutil -lc -lm -ldl -lpthread -lz -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread -L/usr/lib -lavformat -lavcodec -lavutil -ldts -lz -lGL -lGLU -export-dynamic
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o)(.text+0x3f71): In function `posix_tmpnam':
: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o)(.text+0x3ebd): In function `posix_tempnam':
: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/local/blender/obj/linux-glibc2.3.5-i386/intern/OpenALSoundSystem/libOpenALSoundSystem.a(SND_OpenALDevice.o)(.text+0x47f): In function `SND_OpenALDevice::LoadSample(STR_String const&, void*, int)':
SND_OpenALDevice.cpp: undefined reference to `alutLoadWAVMemory'
/usr/local/blender/obj/linux-glibc2.3.5-i386/intern/OpenALSoundSystem/libOpenALSoundSystem.a(SND_OpenALDevice.o)(.text+0x4f1):SND_OpenALDevice.cpp: undefined reference to `alutUnloadWAV'
/usr/local/blender/obj/linux-glibc2.3.5-i386/intern/OpenALSoundSystem/libOpenALSoundSystem.a(SND_OpenALDevice.o)(.text+0x543):SND_OpenALDevice.cpp: undefined reference to `alutLoadWAVFile'
collect2: ld returned 1 exit status
make[1]: *** [/usr/local/blender/obj/linux-glibc2.3.5-i386/bin/blender] Error 1
make: *** [all] Error 1

Have entered 'alut' into the line.... BF_OPENAL_LIB = 'openal alut' ....as was suggested for both the linux2_config.py and linuxcross_config.py files (not sure what the difference is). However, this does not fix the above problem. Any ideas would be much appreciated.

LC.

lcol8548
Posts: 0
Joined: Thu Jun 15, 2006 4:43 pm

forgot to mention...

Post by lcol8548 » Thu Jun 15, 2006 5:08 pm

I have downloaded and compiled openAL-0.0.8 and freealut-1.1.0 packages.

Lazareus
Posts: 0
Joined: Sun Jul 23, 2006 5:24 am

Post by Lazareus » Mon Jul 24, 2006 8:40 am

I think you need to edit linux2_config.py, and set the BF_OPENAL variable to '/usr/local'
I'm guessing that you did not add --prefix=/usr to the 'configure' command when you built those packages.
Hope it helps. :-)

byu_blue
Posts: 0
Joined: Thu Sep 14, 2006 9:26 pm

yep

Post by byu_blue » Thu Sep 14, 2006 9:31 pm

Papulizer's post did it for me. To install blender then install all these packages (dependencies) openl, libalu, libtiff4-dev, python2.4-cxx-dev etc. etc. and then update G++ adn gcc to 4.1, and make sure you odn't link with libstdc++-5.0.so and should work!
(just some notes from my debian install).
Thanks!
-Roger

vaughan
Posts: 0
Joined: Thu Sep 28, 2006 10:47 am
Contact:

Post by vaughan » Tue Dec 26, 2006 5:37 pm

hi dudes!
i've got a similar problem too.
On a FC6 i was compiling with scons when at linking time it crash and says:

Code: Select all

Compiling ==> 'buildinfo.c'
Linking program ==> 'blender'
/usr/bin/ld: skipping incompatible /usr/lib/libjpeg.so when searching for -ljpeg
/usr/bin/ld: skipping incompatible /usr/lib/libjpeg.so when searching for -ljpeg
/usr/bin/ld: skipping incompatible /usr/lib/libpng.so when searching for -lpng
/usr/bin/ld: skipping incompatible /usr/lib/libpng.a when searching for -lpng
/usr/bin/ld: skipping incompatible /usr/lib/libpng.so when searching for -lpng
/usr/bin/ld: skipping incompatible /usr/lib/libpng.a when searching for -lpng
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching for -lfreetype
/usr/bin/ld: cannot find -lgettextlib
collect2: ld returned 1 exit status
scons: *** [/home/luke/build/linux2/bin/blender] Error 1
scons: building terminated because of errors.
i've tried to llok up over google and other forum but nothing up.
any ideas?
"May the penguin B with U!"
Linux registered user #431386

vaughan
Posts: 0
Joined: Thu Sep 28, 2006 10:47 am
Contact:

Post by vaughan » Thu Dec 28, 2006 12:22 pm

Bug killed!!!!!!!
The problem was that on 64bit distribution U have 2 directory /usr/lib and /usr/lib64 where U can find your libraries (.so).
Scons, at linking time, found the same library and he didn't know which one take.
I've resolved 'hiding' the 32bit library and Scons finished well!
"May the penguin B with U!"
Linux registered user #431386

neota
Posts: 0
Joined: Sat Dec 30, 2006 10:37 pm

Post by neota » Sat Dec 30, 2006 10:41 pm

wzzl:
This is a problem with linking order.
I fixed it by inserting a line

env.Append(LINKFLAGS=['-lalut'])

after the 'if crossbuild and env['PLATFORM'] != 'win32': ' block.

papulizers way should have a similar effect; I haven't tried it.

Post Reply