Re: [HOpenGL] problems compiling hopengl on freebsd
On Wed, 28 Aug 2002 09:39:21 +0200, Sven Panne <Sven_Panne@BetaResearch.de> wrote:
Hmmm, that looks OK to me. Perhaps autoconf couldn't find the include path and/or library path for the X11 stuff. Could you send me your config.log, config.status and a transcript of your shell session for configure, please?
when you asked me for config.log and config.status i didnt know they existed and so i resolved to have a look at them to see if that helped. i think it might have. i am not sure but ill run it by you to see if it does. ok. i was looking and i found some lines that made me think that maybe the problem was that some -l flags werent getting specified. they are lines 183 to 202 configure:3710: checking for library containing glEnd configure:3730: gcc -o conftest -g -O2 -I/usr/X11R6/include conftest.c -lSM /tmp/ccL3PAy0.o: In function `main': /usr/home/chris/HOpenGL-1.03/configure(.text+0x7): undefined reference to `glEnd configure:3733: $? = 1 configure: failed program was: #line 3718 "configure" #include "confdefs.h" #include <GL/glut.h> int main () { glEnd() ; return 0; } configure:3762: gcc -o conftest -g -O2 -I/usr/X11R6/include conftest.c -lGL /usr/X11R6/lib/libGL.so: undefined reference to `pthread_getspecific' /usr/X11R6/lib/libGL.so: undefined reference to `pthread_key_create' /usr/X11R6/lib/libGL.so: undefined reference to `pthread_setspecific' some of those lines have been truncated. so i tried creating a test.c which looks like this #include <GL/glut.h> int main() { glEnd(); printf("hello world!\n"); return 0; } then i tried compiling it with gcc test.c -I/usr/X11R6/include -lSM -lICE -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm -pthread -lGL this compiles with no errors. running ./a.out gives hello world!. so i am thinking it is working now. this leads me to think that perhaps the problem is that -lpthread is not getting specified on the commandline. does this sound plausible? sincerly, chris moline
Hi Chris, * Chris Moline <uglydaemon@shaw.ca> [2002-08-29 04:37 +0200]:
this compiles with no errors. running ./a.out gives hello world!. so i am thinking it is working now. this leads me to think that perhaps the problem is that -lpthread is not getting specified on the commandline. does this sound plausible?
BTW, FreeBSD-stable has -pthread (-current -lc_r), not -lpthread. Best to use ${PTHREAD_LIBS} for your port. See /usr/ports/Mk/bsd.port.mk for more. Just my 2 Cents, Olli -- «: IST & IIS _ INF _ UniBwM :: obraun@informatik.unibw-muenchen.de :» «: Tele-Consulting GmbH :: obraun@Tele-Consulting.com :» «: FreeBSD Commmitter :: obraun@FreeBSD.org :»
Chris Moline wrote:
[...] then i tried compiling it with
gcc test.c -I/usr/X11R6/include -lSM -lICE -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm -pthread -lGL
this compiles with no errors. running ./a.out gives hello world!. [...]
I assume that FreeBSD uses Mesa as its OpenGL implementation. During Mesa's build it is tested if compiling with <pthread.h> and linking with -lpthread gives access to pthread_create. In that case, a thread-safe variant of Mesa is built (thread-safe dispatch, per-thread OpenGL context, etc.). Of course this requires linking any OpenGL application with pthreads. Plausible as this explanation is, I've got no idea why the explicit -pthread is needed only for FreeBSD, perhaps some FreeBSD guru can enlighten me. Maybe I have to adjust the configure magic one more time. *sigh* The fix is simple (Bourne shell syntax): LDFLAGS="-pthread" ./configure Cheers, S.
participants (3)
-
Chris Moline -
Oliver Braun -
Sven Panne