Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ti_Poussin

macrumors regular
Original poster
May 6, 2005
210
0
Hi, I run into some trouble with linking an OpenGl, Glut interface with swipl from http://www.swi-prolog.org/

I have make the change to the the code file:
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glu.h>
#endif

The build is made using this command:
gcc -framework GLUT -framework OpenGL -shared -I/opt/local/lib/swipl-5.6.49/include -I/usr/include -I/opt/local/include -fPIC OpenGL.c -o OpenGL.so -L/opt/local/lib/swipl-5.6.49/lib/i386-darwin9.1.0 -L/usr/X11R6/lib -lXmu -L/System/Library/Frameworks/OpenGL.framework/Libraries -L/System/Library/Frameworks/GLUT.framework/Libraries -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib

But I get some error of linking:
Undefined symbols:
"_PL_get_pointer", referenced from:
_c_gluSphere in cc9651Uo.o
...
ld: symbol(s) not found

I'm not sure what is wrong, the code compile and run fine under Linux.
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
Hi, I run into some trouble with linking an OpenGl, Glut interface with swipl from http://www.swi-prolog.org/

I have make the change to the the code file:
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glu.h>
#endif

The build is made using this command:
gcc -framework GLUT -framework OpenGL -shared -I/opt/local/lib/swipl-5.6.49/include -I/usr/include -I/opt/local/include -fPIC OpenGL.c -o OpenGL.so -L/opt/local/lib/swipl-5.6.49/lib/i386-darwin9.1.0 -L/usr/X11R6/lib -lXmu -L/System/Library/Frameworks/OpenGL.framework/Libraries -L/System/Library/Frameworks/GLUT.framework/Libraries -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib

But I get some error of linking:
Undefined symbols:
"_PL_get_pointer", referenced from:
_c_gluSphere in cc9651Uo.o
...
ld: symbol(s) not found

I'm not sure what is wrong, the code compile and run fine under Linux.

I noticed you're linking against an older version of swipl. The current version is 5.6.51. Just to double check, does the line

-L/opt/local/lib/swipl-5.6.49/lib/i386-darwin9.1.0

still refer to a valid path? That is, did you update your swipl installation and not change your link flags?
 

Ti_Poussin

macrumors regular
Original poster
May 6, 2005
210
0
I just check and yes the path is valid, maybe I will try to upgrade, maybe some Leopard fix in it. Anybody else see a problem or something I'm missing here?
 

Ti_Poussin

macrumors regular
Original poster
May 6, 2005
210
0
I just try to install the newest release without more success, change the path for the new one but still got the linking error, look like the glut libraries doesn't have every call or isn't right...

Undefined symbols:
"_PL_get_pointer", referenced from:
_c_gluSphere in cc4NJ7Eg.o
"_main", referenced from:
start in crt1.10.5.o
"_PL_get_atom_chars", referenced from:
_c_glDrawText in cc4NJ7Eg.o
_c_glutCreateWindow in cc4NJ7Eg.o
"_PL_put_integer", referenced from:
_c_glut_reshape in cc4NJ7Eg.o
_c_glut_reshape in cc4NJ7Eg.o
_c_glut_keyboard in cc4NJ7Eg.o
_c_glut_keyboard in cc4NJ7Eg.o
_c_glut_keyboard in cc4NJ7Eg.o
_c_glut_mouse in cc4NJ7Eg.o
_c_glut_mouse in cc4NJ7Eg.o
_c_glut_mouse in cc4NJ7Eg.o
_c_glut_mouse in cc4NJ7Eg.o
_c_glut_motion in cc4NJ7Eg.o
_c_glut_motion in cc4NJ7Eg.o
"_PL_get_integer", referenced from:
_c_glVertex2i in cc4NJ7Eg.o
_c_glVertex2i in cc4NJ7Eg.o
_c_glShadeModel in cc4NJ7Eg.o
_c_glBegin in cc4NJ7Eg.o
_c_glViewport in cc4NJ7Eg.o
_c_glViewport in cc4NJ7Eg.o
_c_glViewport in cc4NJ7Eg.o
_c_glViewport in cc4NJ7Eg.o
_c_glCallList in cc4NJ7Eg.o
_c_glClear in cc4NJ7Eg.o
_c_glEnable in cc4NJ7Eg.o
_c_glBlendFunc in cc4NJ7Eg.o
_c_glBlendFunc in cc4NJ7Eg.o
...
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [osx] Error 1
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.