Compiling on OS X

Started by kappa, January 13, 2011, 23:57:29

Previous topic - Next topic

kappa

I've been trying to compile LWJGL on OS X 10.6 but having some problems.

I've installed a fresh install of eclipse (already have XCode and can compile stuff with it) and checked out LWJGL from the svn trunk.

I've right clicked the build.xml file in eclipse and tried to run it but it fails when trying to compile the natives, i have the following output in the console

Buildfile: /workspace/java-game-lib/LWJGL/build.xml
-initialize:
[initialiazing bin folder] Created dir: /workspace/java-game-lib/LWJGL/bin
[initialiazing native bin folder] Created dir: /workspace/java-game-lib/LWJGL/bin/lwjgl
[initialiazing dist folder] Created dir: /workspace/java-game-lib/LWJGL/dist
[initialiazing docs folder] Created dir: /workspace/java-game-lib/LWJGL/doc/javadoc
[initialiazing temp folder] Created dir: /workspace/java-game-lib/LWJGL/temp
[initialiazing temp/jar folder] Created dir: /workspace/java-game-lib/LWJGL/temp/jar
[initialiazing temp/doc folder] Created dir: /workspace/java-game-lib/LWJGL/temp/doc
[initialiazing temp/res folder] Created dir: /workspace/java-game-lib/LWJGL/temp/res
[initialiazing temp/native folder] Created dir: /workspace/java-game-lib/LWJGL/temp/native
[initialiazing temp/windows folder] Created dir: /workspace/java-game-lib/LWJGL/temp/native/windows
[initialiazing temp/linux folder] Created dir: /workspace/java-game-lib/LWJGL/temp/native/linux
[initialiazing temp/macosx folder] Created dir: /workspace/java-game-lib/LWJGL/temp/native/macosx
[initialiazing temp/solaris folder] Created dir: /workspace/java-game-lib/LWJGL/temp/native/solaris
generators:
[generator] Compiling 116 source files to /workspace/java-game-lib/LWJGL/bin

...

generate-opencl-capabilities:
generate-all:
compile:
     [core] Compiling 457 source files to /workspace/java-game-lib/LWJGL/bin
     [core] Note: Some input files use or override a deprecated API.
     [core] Note: Recompile with -Xlint:deprecation for details.
     [core] Note: /workspace/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/FastIntMap.java uses unchecked or unsafe operations.
     [core] Note: Recompile with -Xlint:unchecked for details.
     [test] Compiling 59 source files to /workspace/java-game-lib/LWJGL/bin
 [examples] Compiling 11 source files to /workspace/java-game-lib/LWJGL/bin
-createjars:
[lwjgl.jar] Building jar: /workspace/java-game-lib/LWJGL/temp/jar/lwjgl.jar
[lwjgl_util_applet.jar] Building jar: /workspace/java-game-lib/LWJGL/temp/jar/lwjgl_util_applet.jar
[lwjgl_test.jar] Building jar: /workspace/java-game-lib/LWJGL/temp/jar/lwjgl_test.jar
[lwjgl_util.jar] Building jar: /workspace/java-game-lib/LWJGL/temp/jar/lwjgl_util.jar
jars:
-jars_NoDEP:
     [move] Moving 4 files to /workspace/java-game-lib/LWJGL/libs
headers:
touch-version:
version-mismatch:
     [echo] 
     [echo] 			lwjgl.java.windows.version = 	private static final int JNI_VERSION = 23;
     [echo] 
     [echo] 			lwjgl.native.windows.version = #define org_lwjgl_WindowsSysImplementation_JNI_VERSION 23L
     [echo] 
     [echo] 			lwjgl.java.linux.version = 	private static final int JNI_VERSION = 19;
     [echo] 
     [echo] 			lwjgl.native.linux.version = #define org_lwjgl_LinuxSysImplementation_JNI_VERSION 19L
     [echo] 
     [echo] 			lwjgl.java.macosx.version = 	private static final int JNI_VERSION = 19;
     [echo] 
     [echo] 			lwjgl.native.macosx.version = #define org_lwjgl_MacOSXSysImplementation_JNI_VERSION 19L
     [echo] 
     [echo] 		
compile_native:
-compile_native_win32:
-compile_native_linux:
-compile_native_solaris:
-compile_native_macosx:
init:
    [mkdir] Created dir: /workspace/java-game-lib/LWJGL/bin/lwjgl/ppc
    [mkdir] Created dir: /workspace/java-game-lib/LWJGL/bin/lwjgl/i386
    [mkdir] Created dir: /workspace/java-game-lib/LWJGL/bin/lwjgl/x86_64
nativelibrary:
compile:
    [apply] In file included from /workspace/java-game-lib/LWJGL/src/native/macosx/context.h:48,
    [apply]                  from /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:41:
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:43:17: error: jni.h: No such file or directory
    [apply] In file included from /workspace/java-game-lib/LWJGL/src/native/macosx/context.h:48,
    [apply]                  from /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:41:
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:67: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h: In function 'safeGetBufferAddress':
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:68: error: 'buffer' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:68: error: (Each undeclared identifier is reported only once
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:68: error: for each function it appears in.)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:72: error: 'env' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h: At top level:
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:78: error: syntax error before 'safeNewBuffer'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:78: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:78: warning: return type defaults to 'int'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h: In function 'safeNewBuffer':
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:79: error: 'p' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:83: error: 'env' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:83: error: 'size' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:86: warning: return makes integer from pointer without a cast
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h: At top level:
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:89: error: syntax error before 'safeNewBufferCached'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:89: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:89: warning: return type defaults to 'int'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h: In function 'safeNewBufferCached':
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:90: error: 'old_buffer' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:91: error: 'env' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:92: error: 'jlong' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:92: error: syntax error before 'capacity'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:93: error: 'p' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:93: error: 'capacity' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:93: error: 'size' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h: At top level:
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:100: error: syntax error before 'offset'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h: In function 'offsetToPointer':
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:101: error: 'offset' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h: At top level:
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:125: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:125: warning: type defaults to 'int' in declaration of 'getThreadEnv'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:125: warning: data definition has no type or storage class
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:126: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:126: warning: type defaults to 'int' in declaration of 'attachCurrentThread'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:126: warning: data definition has no type or storage class
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:132: error: syntax error before 'getVersionString'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:132: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:132: warning: type defaults to 'int' in declaration of 'getVersionString'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:132: warning: data definition has no type or storage class
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:133: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:134: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:135: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:136: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:137: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:139: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:141: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:142: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:143: error: syntax error before 'NewStringNativeWithLength'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:143: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:143: warning: type defaults to 'int' in declaration of 'NewStringNativeWithLength'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:143: warning: data definition has no type or storage class
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:144: error: syntax error before 'NewStringNativeUnsigned'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:144: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:144: warning: type defaults to 'int' in declaration of 'NewStringNativeUnsigned'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:144: warning: data definition has no type or storage class
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:145: error: syntax error before 'NewReadOnlyDirectByteBuffer'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:145: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:145: warning: type defaults to 'int' in declaration of 'NewReadOnlyDirectByteBuffer'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:145: warning: data definition has no type or storage class
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:146: error: syntax error before 'newJavaManagedByteBuffer'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:146: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:146: warning: type defaults to 'int' in declaration of 'newJavaManagedByteBuffer'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:146: warning: data definition has no type or storage class
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:147: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:148: error: syntax error before 'getPointerWrapperAddress'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:148: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:148: warning: type defaults to 'int' in declaration of 'getPointerWrapperAddress'
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:148: warning: data definition has no type or storage class
    [apply] /workspace/java-game-lib/LWJGL/src/native/common/common_tools.h:150: error: syntax error before '*' token
    [apply] In file included from /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:41:
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.h:59: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:54: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m: In function 'loadFramework':
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:57: error: 'env' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m: At top level:
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:70: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m: In function 'extgl_Open':
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:73: error: 'env' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m: At top level:
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:90: error: syntax error before '*' token
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m: In function 'choosePixelFormat':
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:92: error: 'jclass' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:92: error: syntax error before 'cls_pixel_format'
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:93: error: 'use_display_bpp' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:96: error: 'env' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:96: error: 'pixel_format' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:96: error: 'cls_pixel_format' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:113: error: 'jboolean' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:113: error: syntax error before 'allow_software_acceleration'
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:115: error: 'allow_software_acceleration' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:117: error: 'double_buffered' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:128: error: 'support_window' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:130: error: 'support_pbuffer' undeclared (first use in this function)
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:110: warning: unused variable 'sRGB'
    [apply] /workspace/java-game-lib/LWJGL/src/native/macosx/context.m:108: warning: unused variable 'floating_point_packed'

BUILD FAILED
/workspace/java-game-lib/LWJGL/build.xml:393: The following error occurred while executing this line:
/workspace/java-game-lib/LWJGL/build.xml:426: The following error occurred while executing this line:
/workspace/java-game-lib/LWJGL/platform_build/macosx_ant/build.xml:50: The following error occurred while executing this line:
/workspace/java-game-lib/LWJGL/platform_build/macosx_ant/build.xml:22: apply returned: 1


I've likely missed some important step, any idea's on what i'm missing or need to do to get it to compile on OS X?

thx

Matzon

looks like paths in your environment doesn't match the paths in the build file - check out the platform_build/macosx_ant/build.xml file

kappa

thx for that, got it working.

issue was that i was missing "/Developer/SDKs/MacOSX10.3.9.sdk"