Trying to compile on an x64 machine

Started by elettrozero, June 17, 2008, 16:11:52

Previous topic - Next topic

elettrozero

Hi everyone.

Trying to compile version 2RC1 under AMDx64.

I've compiled including c source under native/windows, native/common, native/generated.

Running the test (org.lwjgl.test.WindowCreationTest) tells me
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Daemon\Deskt
op\lwjgl-2.0rc1\native\x64\lwjgl.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at org.lwjgl.Sys$1.run(Sys.java:72)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)
        at org.lwjgl.Sys.loadLibrary(Sys.java:81)
        at org.lwjgl.Sys.<clinit>(Sys.java:98)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
        at org.lwjgl.test.WindowCreationTest.initialize(WindowCreationTest.java:
80)
        at org.lwjgl.test.WindowCreationTest.main(WindowCreationTest.java:284)


Cuold it mean that are missing some .dll ?

elettrozero

Ok, compiled and working.

@Matzon: you were right, I used ant and everything worked

Matzon

can you paste a diff (unless it was just changing the path to the x64 lib folder?)

elettrozero

Consider I use VS2008 ...some expected ENV are not the same...il post here the entere build.xml 'couse I've no diff tool.

<?xml version="1.0"?>

<project name="lwjgl native code, native code" basedir="../../bin/lwjgl" default="compile">
	<property name="native" location="../../src/native"/>
	<property environment="env"/>
	<property name="sdkhome" location="${env.WindowsSdkDir}"/>
	<property name="program_files" location="${env.ProgramFiles}"/>
	<property name="alhome" location="${program_files}\OpenAL 1.1 with EFX SDK"/>
	<property name="dllname" value="lwjgl.dll"/>

	<target name="compile_dir">
		<apply dir="." failonerror="true" executable="cl" dest="." skipemptyfilesets="true">
			<arg line="/Ox /W2 /nologo /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c"/>
			<arg value="/I${sdkhome}\include"/>
			<arg value="/I${alhome}\include"/>
			<arg value="/I${java.home}\..\include"/>
			<arg value="/I${java.home}\..\include\win32"/>
			<arg value="/I${native}\common"/>
			<arg value="/I${native}\windows"/>
			<srcfile/>
			<fileset dir="${native}/windows" includes="*.c"/>
			<fileset dir="${native}/common" includes="*.c"/>
			<fileset dir="${native}/generated" includes="*.c"/>
			<mapper type="glob" from="*.c" to="*.obj"/>
		</apply>
	</target>

	<target name="link">
		<apply dir="." parallel="true" executable="cl" failonerror="true">
			<arg line="/LD /nologo"/>
			<srcfile/>
			<arg line="/Fe${dllname} /link"/>
			<arg value="/LIBPATH:${java.home}\..\lib"/>
			<arg value="/LIBPATH:${sdkhome}\lib\x64"/>
			<arg value="/LIBPATH:${alhome}\libs"/>
			<arg value="/OPT:REF"/>
			<arg value="/OPT:ICF"/>
			<arg line="/DLL /DELAYLOAD:jawt.dll ${libs}"/>
			<fileset dir="." includes="*.obj"/>
		</apply>
	</target>

	<target name="clean">
		<delete>
			<fileset dir="." includes="*.obj"/>
			<fileset dir="." includes="*.dll"/>
			<fileset dir="." includes="*.exp"/>
			<fileset dir="." includes="*.lib"/>
		</delete>
	</target>
	
	<target name="compile">
		<echo message="${sdkhome}"/>
		<echo message="${program_files}"/>
		<property name="libs" value="Kernel32.lib ole32.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib jawt.lib delayimp.lib winmm.lib"/>
		<antcall target="compile_dir"/>
		<antcall target="link"/>
    </target>
</project>