Hello Guest

Several errors during build

  • 6 Replies
  • 51 Views
*

Offline Lobo

  • *
  • 27
Several errors during build
« on: September 11, 2019, 07:31:07 »
Hi,

I tried build lwjgl by myself, but the build exited with errors.

I cloned the git repositry and installed ant and called just "ant build.xml"

Then he is doing something but at the end he doesnt find some packages and exited with errors.

If I try to rebuild I get another error, that he cant find cl.

I have to say that I'm not familiar with ant builds.

I hope someone can help me, thanks.

The first attachment is the log from the initial build (freshly checked out git repo and call ant build.xml)
The second one is if I call the build.xml again, after the build failed.

I have windows 10, in the path and java home variable is linked java 8 u122.

Thanks a lot

Best
Lobo

*

Offline KaiHH

  • ***
  • 195
Re: Several errors during build
« Reply #1 on: September 11, 2019, 07:58:27 »
You need a native compiler chain in the path (e.g. Visual Studio 2019) to fully build LWJGL, because native libraries are being built as part of the ant build.

*

Offline Lobo

  • *
  • 27
Re: Several errors during build
« Reply #2 on: September 11, 2019, 09:02:52 »
Thanks for the answer. I added my installed VS 2017 to the Path variable.

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64;"

If I check out the project new, I get still the same errors. If I try to rebuild I get now new errors, see attachment.

Would be great if you have another idea why it doesnt want to build.

Thanks

Best
Lobo


*

Offline spasi

  • *****
  • 2153
    • WebHotelier
Re: Several errors during build
« Reply #3 on: September 11, 2019, 09:32:48 »
About the initial error: Did you disable some bindings in build-bindings.xml? The build script hasn't been updated to handle every combination gracefully (e.g. a recent change has made GLFW depend on all of: EGL, OpenGL, OpenGL ES, Vulkan). Out of the box though, it should build fine.

On Windows, native compilation requires the MSVC toolchain to be configured properly. The easiest way is to add the vcvarsall.bat script to your PATH (for VS 2019 its default location is: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary). Then run:

Code: [Select]
vcvarsall amd64 // for a x64 build, or
vcvarsall amd64_x86 // for a x86 build (you must also run the LWJGL build with a x86 JDK)

Full instructions for Windows x64:

Code: [Select]
// install VS 2017 or 2019
// install JDK 8+
// install Apache Ant
set JAVA_HOME=<path to JDK 8+>
vcvarsall amd64
ant // compiles templates, generates code, compiles Java and native code, runs tests
ant demo -Dclass=org.lwjgl.demo.glfw.Gears // runs the Gears sample

*

Offline Lobo

  • *
  • 27
Re: Several errors during build
« Reply #4 on: September 11, 2019, 11:23:16 »
Oh great that works! Thanks a lot!

I didnt changed the build-bindings.xml. I giess the full instruction was that what was missing on my attempt to build.

Maybe just a naive question. The build is done and I have a lot of class files now, is there a way that the ant build creates jar files at the end?

Thanks

*

Offline spasi

  • *****
  • 2153
    • WebHotelier
Re: Several errors during build
« Reply #5 on: September 11, 2019, 13:41:19 »
Yes, with "ant release". More instructions:

Code: [Select]
set JAVA8_HOME=<path to JDK 8> // optional, without it you'll get a warning
set JAVA_HOME=<path to JDK 10+> // can build with 8 or 9 too, but 10+ will build all multi-release classes and modern javadoc
set LWJGL_BUILD_OFFLINE=true // optional, without it native libraries will be downloaded from latest LWJGL snapshot. Useful when testing local native code changes.
ant release // see the RELEASE folder when done
ant release -Djavadoc.skip=true // much faster, does not build the per-module javadoc

*

Offline Lobo

  • *
  • 27
Re: Several errors during build
« Reply #6 on: September 11, 2019, 13:57:15 »
Very cool. It works great thanks!