Hi,
(if you have seen similar, skip right to the end...)
I am trying to use gem-0.79 on pd-0.35-test11.linux. After some patching Gem compiles fine (sgiimage uses string instead of bstring, randomF.cpp has some invalid macro).
$ uname -mrsp Linux 2.4.18-pre9 i586 unknown $ gcc --version 2.95.3 $ pwd /home/rfigura/tmp/gem/src/Objects
#### Linking is however not that easy. The Makefile command is like
#### this:
$ ld -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL -lm
-L../AuxLibs/Jpeg -ljpeg -L../AuxLibs/tiff -ltiff
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-L../AuxLibs/td -ltd -L../AuxLibs/particle -lparticle
-L../AuxLibs/liborb -lorb
-lX11 -lXext -ldl
ld: final link failed: Bad value
#### if i would only know what this message means - except of "failed".
#### It is an error caused by most AuxLibs:
$ ld -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL -lm
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-lX11 -lXext -ldl
#### Works. Let's check this Binary... pd says: undefined symbol: __builtin_delete
#### __builtin_delete is a libc function. We need libc. gcc handles this
$ gcc -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL -lm
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-lX11 -lXext -ldl
#### as to be expected pd says: undefined symbol: TIFFOpen
#### Linkage fails if i include some auxlibs. Lets see which file is
#### used:
$ strace ld -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL -lm
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-lX11 -lXext -ldl 2>&1 | grep open | grep tiff
[...]
open("../AuxLibs/tiff/libtiff.a", O_RDONLY)
#### Okay. I have libtiff installed on my machine anyway (its the same #### version) so let's use that one... Next error is about jpeg. I also #### have that one installed...
gcc -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL -lm
-ljpeg -ltiff
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-lX11 -lXext -ldl
#### pd says: undefined symbol: sqrt
#### this is not fair. There *is* an -lm. Do we have a redefinition
#### inside some obscure lib?
$ for i in find ../AuxLibs/ -name "lib*.a"
; do objdump -t $i |
grep sqrt && echo in $i ; done
00000000 F *UND* 00000000 sqrt
in ../AuxLibs/td/libtd.a
#### hand-make td $ cd ../AuxLibs/td/ $ cp Makefile.irix Makefile.linux $ vi Makefile.linux $ diff Makefile.irix Makefile.linux 6,8c6,8 < CC = cc
CC = gcc CFLAGS = -O2
$ env PLATFORM=linux make [...]
$ cd ../../Objects
$ gcc -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL -lm
-ltiff -ljpeg
-L../AuxLibs/gltt -lgltt
-L../AuxLibs/gltt/freetype/lib -lttf
-L../AuxLibs/td -ltd
-lX11 -lXext -ldl
#### ...but the error persists.
$ ls -l /usr/lib/libm.*
-rw-r--r-- 1 root root 470774 Dec 27 15:37 /usr/lib/libm.a
lrwxrwxrwx 1 root root 19 Dec 29 22:51 /usr/lib/libm.so -> ../../lib/libm.so.6
$ ld -verbose -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL -lm -ltiff -ljpeg
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-L../AuxLibs/td -ltd -lX11 -lXext -ldl | grep libm
attempt to open /usr/lib/libm.so failed
attempt to open /usr/lib/libm.a succeeded
$ objdump -t /usr/lib/libm.a | grep " sqrt$"
00000000 w F .text 0000006a sqrt
#### why should i use the shared object (.so) instead?
$ gcc -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL /lib/libm.so.6 -ltiff -ljpeg
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-L../AuxLibs/td -ltd -lX11 -lXext -ldl
#### pd error is replaced (should i be happy?). pd says:
undefined symbol: orb_open
$ cd ../AuxLibs/liborb/
$ make # makefile looks so good
$ cd ../../Objects
$ gcc -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL /lib/libm.so.6 -ltiff -ljpeg
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-L../AuxLibs/td -ltd -L../AuxLibs/liborb -lorb -lX11 -lXext -ldl
#### pd says:
undefined symbol: pColorD__Ff11PDomainEnumfffffffff
#### but we no know how to find it (let's see it once again)
$ for i in find ../AuxLibs/ -name "lib*.a"
; do objdump -t $i |
grep sqrt && echo in $i ; done
#### None? And who is using it?
$ for i in ls *.o
; do objdump -t $i |
grep pColorD__Ff11PDomainEnumfffffffff && echo in $i ; done
00000000 *UND* 00000000 pColorD__Ff11PDomainEnumfffffffff
in part_color.o
00000000 *UND* 00000000 pColorD__Ff11PDomainEnumfffffffff
in particle.o
#### Ahum. I be linking many unnecessary object files?
[...removed lengthy checking...]
#### - No.
#### Let's hand-make particle.
#### Good Makefile but particle uses c++. Will we need libc++?
$ make
g++ -O2 -I. -I.. -I/usr/include -I/usr/include/GL -c system.cpp
system.cpp:100: name lookup of i' changed for new ANSI
for' scoping
system.cpp:139: name lookup of i' changed for new ANSI
for' scoping
#### invisible i.
$ cp system.cpp system.cpp.bak
$ vi system.cpp
$ diff system.cpp.bak system.cpp
100c100
for(int i=group_count; i<new_count; i++)
139c139
for(int i=list_count; i<new_count; i++)
$ make $ cd ../../Objects #### i don't have libglut installed so the pspray demo won't work.
#### make libttf $ cd ../AuxLibs/gltt/freetype/lib $ make
#### gltt depends on ttf... remake it. FTFont.h:1: ANSI C++ forbids declaration `Copyright' with no type #### cough cough. This is not a c++ file. http://ftp.mayn.de/pub/unix/graphic/moonlight/gltt-1.8.tar.gz #### $ pwd /home/rfigura/tmp/gem/src/AuxLibs/ $ tar xzvf gltt-1.8.tar.gz $ cd gltt-1.8 $ ln -s ../freetype . $ ln -s ../Makefile . $ make libgltt.a $ cp libgltt.a ..
#### pd says: undefined symbol: __pure_virtual
#### we need g++ to link?
g++ -shared -L/usr/X11R6/lib -o ../../Gem.pd_linux *.o
-lGLU -lGL /lib/libm.so.6 -ljpeg -ltiff
-L../AuxLibs/gltt -lgltt -L../AuxLibs/gltt/freetype/lib -lttf
-L../AuxLibs/td -ltd -L../AuxLibs/particle -lparticle
-L../AuxLibs/liborb -lorb
-lX11 -lXext -ldl
#### Nope, pd is still persisting about __pure_virtual
#### Does someone understand what is going on here, please? I am quite frustrated. I've been for a week on this. I...
--- communication suddenly terminated ---
Greetings