How to build lwjgl on windows?

Started by pjohnsen, August 28, 2011, 16:53:19

Previous topic - Next topic

pjohnsen

Hi,

I've tried using VC++ 2008 Express, VC++ 2010 Express and mingw64 with no luck. Get various degrees of unresolved external when linking. When I'm closest (VC++ 2010) it's related to jawt.dll. The error I get looks like this post: http://lwjgl.org/forum/index.php/topic,2784.0.html

I'm building on win7 64bit, but would actually like to build both 64 and 32 bit.

The docs just says run ant, maybe we could add some more info about compiler setup etc.

Matzon

afaik, 64bit is a bit of an issue in general on windows 7.

I have installed: Visual C++ Express, Windows SDK and Direct X SDK.
Open up 'Visual Studio 2008 Command Prompt' navigate to folder and type ' ant compile_native'

This should work for 32bit. I seem to remember an issue with 64bit and linking. Not sure about what endolf has installed on the buildfarm which seems to work fine :)

pjohnsen

64-bit works fine with vc++ 2010 express (I've compiled PS plugins, blender among others).

When trying exactly what you described (vc++ 2008 expr command prompt, ant compile_native) I get a whole bunch of unresloved exts. From what I can see it is trying to do a 64bit build (which won't work with vc++ 2008 expr). If I understand the ant script correctly it uses os.arch to decide whether to build 32 or 64 bit ... which means I can't build 32 bit on win7 64bit ???

Matzon

could be... I only compile 32bit on my 32bit windows - and avoid it on my 64bit :)

Endolf

Hi

os.arch is set by the jvm, if you have a 32 bit jdk and a 64 bit jdk installed you can build both. That's how the build farm does it. VS express works fine for 64bit as long as you have the platform SDK installed and fiddle with some environment vars.

If you look at the VS set vars batch file for VC++ you'll see values for FrameworkDir LIB and libpath, if you tweak those to include the 64 bit directories it will build quite happily, you'll need to set the back fro 32 bit builds.

Endolf

pjohnsen

Ok, here is what Im doing.


  • I have VC++2010expr SP1 and WindowsSDK 7.1 installed.
  • I open the vs2010 command prompt
  • Go to the LWJGL dir and write ant compile_native
  • I get this error during linking:
link:
    [apply]    Creating library lwjgl64.lib and object lwjgl64.exp
    [apply] LINK : warning LNK4199: /DELAYLOAD:jawt.dll ignored; no imports foun
d from jawt.dll
    [apply] org_lwjgl_opengl_AWTSurfaceLock.obj : error LNK2019: unresolved exte
rnal symbol __imp__JAWT_GetAWT@8 referenced in function _Java_org_lwjgl_opengl_A
WTSurfaceLock_lockAndInitHandle@16
    [apply] lwjgl64.dll : fatal error LNK1120: 1 unresolved externals

BUILD FAILED
C:\lwjgl\build.xml:434: The following error occurred while executing this line:
C:\lwjgl\build.xml:454: The following error occurred while executing this line:
C:\lwjgl\platform_build\windows_ant\build.xml:64: The following error occurred w
hile executing this line:
C:\lwjgl\platform_build\windows_ant\build.xml:32: apply returned: 2


Here are my env lib/inc/framework settings:
FrameworkDir=c:\Windows\Microsoft.NET\Framework64\
FrameworkDIR32=c:\Windows\Microsoft.NET\Framework64\
FrameworkVersion=v4.0.30319
FrameworkVersion32=v4.0.30319
INCLUDE=c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Progra
m Files (x86)\Microsoft SDKs\Windows\v7.0A\include;
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_24
LIB=c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB;C:\Program Files
(x86)\Microsoft SDKs\Windows\v7.0A\lib;
LIBPATH=c:\Windows\Microsoft.NET\Framework64\v4.0.30319;c:\Windows\Microsoft.NET
\Framework64\v3.5;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB;


Not sure which of those I should change .. normally this just works for me when compiling 64bit with vc++2010expr