Cannot build natives for Windows

Started by monkey_scratchess_head, December 14, 2008, 17:36:05

Previous topic - Next topic

monkey_scratchess_head

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? ???

Matzon

Please use visual express to compile. I seem to remember an issue with the free compiler supporting /delayload

monkey_scratchess_head

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

Matzon

hmm, no you should just open a visual studio command prompt and then do a ant compile_native - wonder if its related to 64bit ?

monkey_scratchess_head

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!

Matzon

it may already work with mingw-64. I know elias mentioned that he had compiled with it.

monkey_scratchess_head

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?

Matzon

the 64bit keeps comming back to me ... are you using a 64 bit VM ?

monkey_scratchess_head

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).