[ODE] OSX compile problems...

Stan Shebs shebs at apple.com
Thu Jan 9 16:54:02 2003


orange144 wrote:

> hello everyone,
>
> I'm trying t build ode on macosx 10.2.3, with the X11 lib beta (the 
> one apple provided two days ago).

This reminds me, I recently constructed a glut.cpp as an alternative to 
x11.cpp
for drawstuff tests and which would presumably work on any GLUT system
including OS X.  Is anybody interested?

>
> i've had to tune the makefile to use the X11 libraries and includes, 
> but i managed to compile ode and drawstuff
> ( i mean, "make ode-lib" and "make drawstuff-lib")
> but when i try to compile the ode-test and drawstuff-test, i get
>
> ld: archive: lib/libode.a has no table of contents,
> add one with ranlib(1) (can't load from it)
>
> plus the same message for lib/libdrawstuff.a
>
> ok never mind, let's do some ranlib
> (i read the previous discussion on this board here: 
> <http://q12.org/pipermail/ode/2002-November/002338.html> )

libtool is your friend, it knows about details like this. :-)

>
> and when i re-make, here is what i get then:
>
> 109 [23:18:29] ~/Desktop/ode-0.03 > make ode-test
> gcc -o ode/test/test_chain2.exe ode/test/test_chain2.o lib/libode.a 
> lib/libdrawstuff.a -L/usr/X11R6/lib -lX11 -lGL -lGLU -lm
> ld: Undefined symbols:
> operator delete[](void*)
> operator delete(void*)
> operator new[](unsigned long)
> operator new(unsigned long)
> make: *** [ode/test/test_chain2.exe] Error 1
>
> something's missing, huh? i guess it may be a problem related to X11 
> more than ode, but if someone has an idea, it will be very appreciated.

You have to link with the C++ library.  Either add a -ldstdc++ manually, 
or use "g++"
to link instead of "gcc", which will add the library automatically.

Incidentally, I work in Apple's tools group, so can answer random 
compiler questions
with at least a little bit of authority... :-)

Stan