Hello Guest

Cannot build natives for Windows

  • 8 Replies
  • 17896 Views
Cannot build natives for Windows
« on: December 14, 2008, 17:36:05 »
Hello everyone!

I've run into a spot of bother, I've been trying to build the LWJGL application and natives for Windows, so I followed the instructions in the Wiki ...but for me they didn't work & I get the below error when running the ant compile_native.

link:
    [apply]    Creating library lwjgl.lib and object lwjgl.exp
    [apply] LINK : warning LNK4199: /DELAYLOAD:jawt.dll ignored; no imports found from jawt.dll
    [apply] org_lwjgl_opengl_AWTSurfaceLock.obj : error LNK2019: unresolved external symbol __imp__JAWT_GetAWT@8 referenced in function _Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle@16
    [apply] lwjgl.dll : fatal error LNK1120: 1 unresolved externals

BUILD FAILED
C:\LWJGL\build.xml:253: The following error occurred while executing this line:
C:\LWJGL\build.xml:271: The following error occurred while executing this line:
C:\LWJGL\platform_build\windows_ant\build.xml:57: The following error occurred w
hile executing this line:
C:\LWJGL\platform_build\windows_ant\build.xml:29: apply returned: 2


Now, although I'm not an experienced c/c++ programmer I'd guess something here is not quiet right, anyway...

The build enviroment is
  • Windows Vista Premium 64bit
  • Microsoft SDK (Novemeber 2008)
  • OpenAL SDK1.1
  • Java 6

Any pointers here? ???

*

Offline Matzon

  • *****
  • 2242
Re: Cannot build natives for Windows
« Reply #1 on: December 14, 2008, 18:31:42 »
Please use visual express to compile. I seem to remember an issue with the free compiler supporting /delayload

Re: Cannot build natives for Windows
« Reply #2 on: December 14, 2008, 19:36:35 »
I used the 'Visual Studio Command Prompt' which was installed with Visual C++ Express Edition. The Wiki instructed to run the ant command through that promt, which is where I encountered the problem (sorry for not making that clear).

The VC++ editor came as part of the install as well, so use that instead?

...I'll give it a shot and get back to you.

Thanks for the quick reply

*

Offline Matzon

  • *****
  • 2242
Re: Cannot build natives for Windows
« Reply #3 on: December 14, 2008, 20:20:15 »
hmm, no you should just open a visual studio command prompt and then do a ant compile_native - wonder if its related to 64bit ?

Re: Cannot build natives for Windows
« Reply #4 on: December 14, 2008, 21:24:10 »
Ah, yes, I hoped it would all just work ...but sadly not for me, not today  :-\.

It could well be something to do with the 64bit, as I've now been looking around on the msdn site, found a comparison table and the Express edition doesn't seem to support 64bit compilation, only 32bit (it's almost like they want you to use a version you actually have to pay for  ;D).

Unfortunately I actually need to build it so the dll's work with the Windows x64 Java install, so 64bit it has to be. I've setup mMnGW-64 and tomorrow I'll see if that want to play nicely.

I'm guessing I should just need to customise the ant script to use the minGW compiler & linker with the appropriate options?

Again, advice on this is welcome!

*

Offline Matzon

  • *****
  • 2242
Re: Cannot build natives for Windows
« Reply #5 on: December 14, 2008, 22:00:25 »
it may already work with mingw-64. I know elias mentioned that he had compiled with it.

Re: Cannot build natives for Windows
« Reply #6 on: December 15, 2008, 18:23:08 »
Ah, after looking around there's a folder among the native builds called mingw_build and after a few enviroment variables setting up and one or two property changes the file's good to go.

...obviously it still didn't work tho  ::)

Again failing on the native builds, and on the same part:

link:
    [apply] C:\LWJGL\bin\lwjgl\org_lwjgl_opengl_AWTSurfaceLock.o:org_lwjgl_opengl_AWTSurfaceLock.c:(.text+0x7a): undefined reference to `_imp__JAWT_GetAWT'
    [apply] collect2: ld returned 1 exit status

BUILD FAILED
C:\LWJGL\build.xml:253: The following error occurred while executing this line:
C:\LWJGL\build.xml:271: The following error occurred while executing this line:
C:\LWJGL\platform_build\windows_ant\build.xml:54: The following error occurred while executing this line:
C:\LWJGL\platform_build\windows_ant\build.xml:33: apply returned: 1


I'm mat be more than a bit rusty with C compiler errors, but it's starting to look like this is to be down to the jawt library, in both the Express and MinGW cases. It's almost like it's just not finding the jawt library, but when I move the jawt.lib there's a different error about being unable to find the jawt library, so something else must be up, no idea what tho  ???

Have I missed anything obvious out?

*

Offline Matzon

  • *****
  • 2242
Re: Cannot build natives for Windows
« Reply #7 on: December 15, 2008, 18:50:46 »
the 64bit keeps comming back to me ... are you using a 64 bit VM ?

Re: Cannot build natives for Windows
« Reply #8 on: December 15, 2008, 22:17:25 »
I tried both the 64 and 32 bit JVM and both have the same result with mingw-64 ...namely not the one I wanted. However today I tried the Visual Express with the 32bit JVM and it successfully compiled!

I would imagine the reason VisualExpress fails with the 64bit JVM is that it does support 64bit compilation, only 32bit.

The mingw64 however consistently fails with the same reason, so I suspect there may be some compiler flag / include / magic pixie dust that I'm missing, what exactly it is tho, is anyones guess (I'll have to ask some questions on the sun jni forum).