Several errors during build

Started by Lobo, September 11, 2019, 07:31:07

Previous topic - Next topic



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



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.


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.




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:

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:

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


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?



Yes, with "ant release". More instructions:

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


Very cool. It works great thanks!