[ODE] Newbie: gcc apparently not finding libode.a

Max Lungarella max.lungarella at aist.go.jp
Thu Dec 12 16:52:02 2002


hi there,

that's right, both solutions are viable. if you plan to use gcc/g++, in
the long run you'd be better off with a "makefile" though. "man
makefile" and a search on goggle should provide you with enough
info/examples to get started.

cheers,
	max


> I tried compiling it too and got the same errors. The problem is that
> -lode needs to go after main.c on the command line. 
>  
> Both of the following work. 
>  
> g++ -oodetest main.c -lode 
> gcc -oodetest main.c -lode -lm -lstdc++ 
>  
> Good luck, 
>  
> > Hello everyone, 
> >  
> > I'm having a problem creating an application using ODE. I have 
> succesfully 
> > configured and compiled lib-ode. I've copied libode.a to 
> /usr/lib/libode.a 
> > (I'm using Mandrake 8.2 on x86). The include files are copied to 
> > /usr/include/ode, and they work well. I wrote this small test file
> > to see if 
> > the library was working: 
> >  
> > /* main.c */ 
> > #include <stdio.h> 
> > #include <stdlib.h> 
> > #include <string.h> 
> > #include <ode/ode.h> 
> >  
> > int main(int argc, char* args[]) 
> > { 
> >         // create world 
> >         dWorldID world; 
> >         dWorldSetERP (world, 0.01); 
> >  
> >         return 0; 
> > } 
> >  
> > I compile it using the command: 
> > gcc -L/usr/lib/ -lode -oodetest main.c 
> >  
> > I've tried about everything with the -l and -L switches, but I keep 
> getting 
> > the following error: 
> > /tmp/ccUXVR2r.o: In function `main': 
> > /tmp/ccUXVR2r.o(.text+0x17): undefined reference to `dWorldSetERP' 
> > collect2: ld returned 1 exit status 
> >  
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode