Error when building JOGL - Help~

Hello…
I’m a beginner in JOGL and Ant. Currently I’m trying to build the JOGL which I have checked out from the CVS using Ant.
I have followed the step-by-step “How to build the JOGL OpenGL binding for Java” (at least that’s what I thought :P), but I still get Build Failed.
It displays the following error (under c.build):
fatal error C1083: Cannot open include file: ‘jni.h’: no such file or directory

Can somebody tell me how can I fix it?
Thanks in advance :slight_smile:

-EDIT-
I tried commenting the java.home.dir setting in the jogl properties, and now it doesn’t have the above problem anymore. But now it has errors in the InternalBufferUtils like:
error C2065: ‘intptr_t’ : undeclared identifier
error C2146: syntax error :'missing ‘)’ before identifier ‘address’

:-[

What OS are you running on? What compiler are you using? If you’re on Windows, do you have the win32.c.compiler property correctly set in your jogl.properties file?

I’m running on Windows. I set the property as win32.c.compiler=vc7 because in my computer there’s Microsoft Visual .Net 2003 with Vc7 in it…

I always get Build Failed error when executing this line:

C:\eclipse3.1\CVS_JOGL\jogl\make\build.xml:1420: The following error occurred wh
ile executing this line:
C:\eclipse3.1\CVS_JOGL\jogl\make\build.xml:982: The following error occurred whi
le executing this line:
C:\eclipse3.1\CVS_JOGL\jogl\make\build.xml:937: Could not launch cl: java.io.IOE
xception: CreateProcess: cl /W3 /Ob1 /GF /Gy /GS /Wp64 /RTCcsu /c /nologo /DNDEB
UG /MD /DNDEBUG /IC:\eclipse3.1\CVS_JOGL\jogl\make\stub_includes\opengl /IC:\wat
erlogic\j2sdk1.5\include /IC:\waterlogic\j2sdk1.5\include\win32 C:\eclipse3.1\CV
S_JOGL\jogl\src\native\jogl\InternalBufferUtils.c error=2

Before executing ant you need to execute the vcvars32.bat file from your Vc7/Bin directory to get cl.exe in your PATH.

hi,
it still cannot build successfully. But what I got now is:

java.generate.gl:
     [echo] Generating GL interface and implementation
  [gluegen] java.io.FileNotFoundException: make\stub_includes\common\gl.c (The s
ystem cannot find the path specified)
  [gluegen]     at java.io.FileInputStream.open(Native Method)
  [gluegen]     at java.io.FileInputStream.<init>(FileInputStream.java:106)
  [gluegen]     at java.io.FileInputStream.<init>(FileInputStream.java:66)
  [gluegen]     at java.io.FileReader.<init>(FileReader.java:41)
  [gluegen]     at com.sun.gluegen.GlueGen.run(GlueGen.java:102)
  [gluegen]     at com.sun.gluegen.GlueGen.main(GlueGen.java:297)
  [gluegen] Exception occurred while generating glue code. Exiting.

BUILD FAILED
C:\eclipse3.1\CVS_JOGL\jogl\make\build.xml:1417: The following error occurred wh
ile executing this line:
C:\eclipse3.1\CVS_JOGL\jogl\make\build.xml:558: The following error occurred whi
le executing this line:
C:\eclipse3.1\CVS_JOGL\jogl\make\build.xml:526: GlueGen returned: 1

I really have no idea what’s going wrong with your build setup. Things seem to be working pretty well for most people who have checked out the source tree. I would suggest you check out a fresh copy and go step-by-step again through the build instructions. Make sure you’re cd’d into the jogl/make directory when you execute “ant”.

Yeah I tried the steps all over again,
but still got error

c.build:
     [echo] Output lib name = jogl
       [cc] 5 total files to be compiled.
       [cc] WGL_JNI.c
       [cc] InternalBufferUtils.c
       [cc] C:\eclipse3.1\jogl\jogl\src\native\jogl\InternalBufferUtils.c(53) :
error C2065: 'intptr_t' : undeclared identifier
       [cc] C:\eclipse3.1\jogl\jogl\src\native\jogl\InternalBufferUtils.c(53) :
warning C4312: 'type cast' : conversion from 'int' to 'void *' of greater size
       [cc] C:\eclipse3.1\jogl\jogl\src\native\jogl\InternalBufferUtils.c(53) :
error C2146: syntax error : missing ')' before identifier 'address'
       [cc] C:\eclipse3.1\jogl\jogl\src\native\jogl\InternalBufferUtils.c(53) :
error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
       [cc] C:\eclipse3.1\jogl\jogl\src\native\jogl\InternalBufferUtils.c(53) :
error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
       [cc] C:\eclipse3.1\jogl\jogl\src\native\jogl\InternalBufferUtils.c(53) :
error C2143: syntax error : missing ')' before 'identifier'
       [cc] C:\eclipse3.1\jogl\jogl\src\native\jogl\InternalBufferUtils.c(53) :
error C2198: 'function through pointer' : too few arguments for call through poi
nter-to-function
       [cc] C:\eclipse3.1\jogl\jogl\src\native\jogl\InternalBufferUtils.c(53) :
error C2059: syntax error : ')'
       [cc] GLImpl_JNI.c
       [cc] GLU_JNI.c
       [cc] WGLExtImpl_JNI.c
       [cc] Generating Code...

BUILD FAILED
C:\eclipse3.1\jogl\jogl\make\build.xml:1420: The following error occurred while
executing this line:
C:\eclipse3.1\jogl\jogl\make\build.xml:982: The following error occurred while e
xecuting this line:
C:\eclipse3.1\jogl\jogl\make\build.xml:937: cl failed with return code 2

Total time: 38 seconds

Thanks anyway :slight_smile:

I’m not sure why VS .NET 2003 would fail to build JOGL as I’m pretty sure it’s been used by others. However you may be able to hack things by adjusting the _MSC_VER test in InternalBufferUtils.c and some of the other native code files.