Build problem on FreeBSD

I’ve posted this in the JOGL issue tracker before and was redirected here.

My build fails in the c.build stage:

c.build:
[echo] Output lib name = jogl
[cc] 6 total files to be compiled.
[cc] cc1: warning: command line option “-fno-rtti” is valid for C++/ObjC++ but not for C
[cc] cc1: warning: command line option “-fno-rtti” is valid for C++/ObjC++ but not for C
[cc] cc1: warning: command line option “-fno-rtti” is valid for C++/ObjC++ but not for C
[cc] /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLX_JNI.c: In function Java_com_sun_opengl_impl_x11_GLX_dispatch_1glXChooseFBConfig0__JILjava_lang_Object_2ILjava_lang_Object_2IJ': [cc] /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLX_JNI.c:381: error: syntax error before "ptr_glXChooseFBConfig" [cc] /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLX_JNI.c:395: error: ptr_glXChooseFBConfig’ undeclared (first use in this function)
[cc] /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLX_JNI.c:395: error: (Each undeclared identifier is reported only once
[cc] /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLX_JNI.c:395: error: for each function it appears in.)
[cc] /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLX_JNI.c:395: error: `PFNGLXCHOOSEFBCONFIGPROC’ undeclared (first use in this function)
[cc] /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLX_JNI.c:395: error: syntax error before “intptr_t”

[lots of similar errors follow, for a complete buildlog see https://jogl.dev.java.net/issues/show_bug.cgi?id=239]

It was suggested that I “don’t have an OpenGL / Mesa installation on the box on which you’re trying to build.”, but I’m quite sure I actually do have all the required headers and libraries. It might be an issue of wrong CFLAGS/LDFLAGS, but since I’m a complete novice regarding this buildsystem (and ant in general), I have no idea where to look for those (or even how to find out what the exact invocation of gcc which are failing here look like).

Any suggestions and debugging tips appreciated.

Small update: I just discovered ant -v :slight_smile: and it looks like the problem is not about missing include paths either:

[cc] gcc -c -fno-rtti -fPIC -I/usr/X11R6/include -I/usr/home/lofi/foobar/jogl/make/stub_includes/opengl -I/usr/local/jdk1.5.0/include -I/usr/local/jdk1.5.0/include/freebsd /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLX_JNI.c /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLImpl_JNI.c /usr/home/lofi/foobar/jogl/build/gensrc/native/jogl/GLU_JNI.c

looks about right to me. The gl[x][ext] headers are all there in /usr/X11R6/include as well and seem to contain the correct typedefs, too.

In the build.xml, in the definition of “compiler.cfg.freebsd”, try adding the stub_includes/opengl directory before /usr/X11R6:


      <compiler id="compiler.cfg.freebsd" name="gcc">
        <includepath path="stub_includes/opengl"/>
        <includepath path="/usr/X11R6/include" />
      </compiler>

Do you have a /usr/include/inttypes.h defining e.g. intptr_t?

That did it, many thanks!

No problem. I’ve checked in this fix.