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 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.