Building Defold Engine on Windows

I want to try and join in with any contribution I can make on the code side of Defold. I am having trouble setting up the environment, though. I am not familiar with waf, and following the setup and build process leads me to errors which I cannot seem to fix.

I managed to figure out that I can only do it through the git bash shell. Then I was able to run ./scripts/build.py shell without issue. Then I was able to run ./scripts/build.py install_ext --platform=win32. I didn’t run the install_sdk step was optional for windows from what I understand.

Finally I got to ./scripts/build.py build_engine --platform=win32 which leads to an error:

Waf: Leaving directory `E:\defold\engine\dlib\build'
Build failed
 -> task in '' failed with exit status 2 (run with -v to display more information)

[exec] python E:\defold\tmp\dynamo_home/ext/bin/waf --prefix=E:\defold\tmp\dynamo_home distclean configure build install --platform=x86_64-win32
Error:
Traceback (most recent call last):
  File "E:\defold\scripts\build.py", line 2548, in <module>
    f()
  File "E:\defold\scripts\build.py", line 1249, in build_engine
    self._build_engine_lib(args, lib, host)
  File "E:\defold\scripts\build.py", line 1197, in _build_engine_lib
    run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)
  File "E:\defold\build_tools\run.py", line 98, in env_command
    return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\defold\build_tools\run.py", line 75, in _exec_command
    raise e
run.ExecException: 1

… and possibly this file was the error one but the message speaks nothing to me:

[177/487] Compiling src\mbedtls\crypto\library\platform_util.c
warning: [options] bootstrap class path not set in conjunction with -source 7
error: Source option 7 is no longer supported. Use 8 or later.
error: Target option 7 is no longer supported. Use 8 or later.

[178/487] Compiling src\mbedtls\crypto\library\pkwrite.c
certs.c

How can I compile the Defold engine easily? The build process seems quite complicated. I also tried running the above steps with --platform=x86_64-win32

1 Like

If all prerequisites are installed as mentioned in the guides (E.g java 17, Python 3, Visual Studio, git-bash), then the steps are:

./scripts/build.py shell
./scripts/build.py install_ext
./scripts/build.py build

If no platform is specified, it defaults to the current platform.
In your case, if it’s a 64 bit machine, you may use “–platform=x86_64-win32”.
“win32” is the name of the 32bit target.

How can I compile the Defold engine easily?

Personally, I think those steps are quite few and distinct.

In terms of error messages, it’s difficult to say, as you only posted the last bit, whereas I suspect there are more information earlier in your logs. When regarding errors, it’s always best to start at the top, as the rest of the errors might be cause by the first ones.

I hope this helps.

“error: Source option 7 is no longer supported”

Which version of java do you use?
It should show in the configure steps in the build log.

Hey, Indeed I had a greater version of Java installed for another project (java 21). I installed the correct version but now it seems to be giving me another error. If I build it stops at waiting for the unit test server which doesn’t start in 15 seconds:

Waiting for HTTP testserver to start
HTTP server failed to start within 15 seconds
'.' is not recognized as an internal or external command,
operable program or batch file.

[exec] python E:\defold\tmp\dynamo_home/ext/bin/waf --prefix=E:\defold\tmp\dynamo_home distclean configure build install --platform=x86_64-win32
Error:
Traceback (most recent call last):
  File "E:\defold\scripts\build.py", line 2548, in <module>
    f()
  File "E:\defold\scripts\build.py", line 1249, in build_engine
    self._build_engine_lib(args, lib, host)
  File "E:\defold\scripts\build.py", line 1197, in _build_engine_lib
    run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)
  File "E:\defold\build_tools\run.py", line 98, in env_command
    return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\defold\build_tools\run.py", line 75, in _exec_command
    raise e
run.ExecException: 1

or if I run it with --skip-tests I get another error:

[...]
- install E:\defold\tmp\dynamo_home\ext\include\basis\encoder\jpgd.h (from src\basis\encoder\jpgd.h)
- install E:\defold\tmp\dynamo_home\ext\include\basis\encoder\pvpngreader.h (from src\basis\encoder\pvpngreader.h)
Waf: Leaving directory `E:\defold\engine\dlib\build'
'install' finished successfully (0.697s)
Building jni for x86_64-win32
[exec] python E:\defold\tmp\dynamo_home/ext/bin/waf --prefix=E:\defold\tmp\dynamo_home --skip-tests distclean configure build install --platform=x86_64-win32
'distclean' finished successfully (0.000s)
Setting top to                           : E:\defold\engine\jni
Setting out to                           : E:\defold\engine\jni\build 
Checking for program 'valgrind'          : not found 
Checking for program 'ccache'            : C:\Path\ccache.exe 
[exec] E:\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --sdk_root
[exec] E:\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --sdk_version
[exec] E:\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --includes
[exec] E:\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --lib_paths
[exec] E:\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --bin_paths
[exec] E:\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --vs_root
[exec] E:\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --vs_version
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe 
Checking for program 'CL'                : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64\CL.exe
Checking for program 'LINK'              : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64\LINK.exe 
Checking for program 'LIB'               : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64\LIB.exe
Checking for program 'RC'                : C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\RC.exe
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe
Checking for program 'javac'             : C:\Program Files\Microsoft\jdk-17.0.12.7-hotspot\bin\javac.exe
Checking for program 'java'              : C:\Program Files\Microsoft\jdk-17.0.12.7-hotspot\bin\java.exe
Checking for program 'jar'               : C:\Program Files\Microsoft\jdk-17.0.12.7-hotspot\bin\jar.exe
Checking for program 'javadoc'           : C:\Program Files\Microsoft\jdk-17.0.12.7-hotspot\bin\javadoc.exe
Checking for program 'valgrind'          : not found 
Checking for program 'ccache'            : C:\Path\ccache.exe
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe
Checking for program 'CL'                : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64\CL.exe
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe 
Checking for program 'javac'             : C:\Program Files\Microsoft\jdk-17.0.12.7-hotspot\bin\javac.exe
Checking for program 'java'              : C:\Program Files\Microsoft\jdk-17.0.12.7-hotspot\bin\java.exe
Checking for program 'jar'               : C:\Program Files\Microsoft\jdk-17.0.12.7-hotspot\bin\jar.exe
Checking for program 'javadoc'           : C:\Program Files\Microsoft\jdk-17.0.12.7-hotspot\bin\javadoc.exe
  src\test\jni/Testapi.empty.cpp => Testapi
Traceback (most recent call last):
  File "E:\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Scripting.py", line 119, in waf_entry_point
    run_commands()
  File "E:\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Scripting.py", line 182, in run_commands
    ctx=run_command(cmd_name)
        ^^^^^^^^^^^^^^^^^^^^^
  File "E:\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Scripting.py", line 173, in run_command
    ctx.execute()
  File "E:\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Configure.py", line 85, in execute
    super(ConfigurationContext,self).execute()
  File "E:\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Context.py", line 92, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "E:\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Context.py", line 133, in recurse
    user_function(self)
  File "E:\defold\engine\jni\wscript", line 24, in configure
    conf.recurse('src')
  File "E:\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Context.py", line 133, in recurse
    user_function(self)
  File "E:\defold\engine\jni\src\wscript", line 11, in configure
    conf.recurse('test')
  File "E:\defold\tmp\dynamo_home\ext\bin\waf3-2.0.23-7dbdd0b348178777c338c9a31f6218a5\waflib\Context.py", line 133, in recurse
    user_function(self)
  File "E:\defold\engine\jni\src\test\wscript", line 31, in configure
    gen_java.generate(header_path   = make_path('./testapi.h'),
  File "E:\defold\engine\jni\scripts\gen_java.py", line 1207, in generate
    ir = gen_ir.gen(source_path, includes, module_name, namespace, [])
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\defold\engine\jni\scripts\external\gen_ir.py", line 223, in gen
    ast = clang_cpp(source_path, includes)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\defold\engine\jni\scripts\external\gen_ir.py", line 220, in clang_cpp
    return subprocess.check_output(cmd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\capit\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\capit\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\capit\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\capit\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

[exec] python E:\defold\tmp\dynamo_home/ext/bin/waf --prefix=E:\defold\tmp\dynamo_home --skip-tests distclean configure build install --platform=x86_64-win32
Error:
Traceback (most recent call last):
  File "E:\defold\scripts\build.py", line 2548, in <module>
    f()
  File "E:\defold\scripts\build.py", line 1249, in build_engine
    self._build_engine_lib(args, lib, host)
  File "E:\defold\scripts\build.py", line 1197, in _build_engine_lib
    run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)
  File "E:\defold\build_tools\run.py", line 98, in env_command
    return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\defold\build_tools\run.py", line 75, in _exec_command
    raise e
run.ExecException: 2

In the first case, there seem to be a missing tool, not sure which yet.

In the second, we require Clang to be installed with Visual Studio as well.

I found the build process too complicated. I would rather stick to an engine like Godot. I got hyped up by Defold, but not being able to contribute is a real bummer and also a turnoff for me personally as a programmer.

You have to simplify the requirements - concrete compiler like clang, waf system and python when it could be a standard CMake build + python for complicated stuff. A lot of manual steps…

Maybe this comment will help you out or maybe you like to have a more closed ecosystem (since you have paid developers). I just wanted to share some feedback.

We would like to improve. Could you please provide an example of build instructions that you like? You mentioned Godot. Would you say the build instructions for Windows are easy to follow for someone new to Godot?

Godot is pretty straightforward - install our build tool scons and visual studio and the rest would work by issuing scons platform=windows compiledb=yes vsproj=yes ...

On some places where I worked it was a practice to have a script that does all the setup for you if there were more dependencies - kind of like what you have for the WSL.

Generally I find that it is bad that:

  • I have to install java, python, visual studio, clang and a lot more
  • I am forced to use clang
  • I am forced to use a simple text editor. I love CLion or Rider. I would be content with Visual Studio. But I didn’t saw a way to get intellisense in any of these tools. Generating compile_commands.json from the build would be enough for me to be able to use CLion. Intellisense is almost always a must for an open-source project for me since I am going to do this on the side and I don’t have time to memorize every file and structure.
  • I am forced to use git-bash or otherwise nothing builds.

And even when I double and triple checked that I am having all the tools, I managed to compile and the tests started running there is still some error with the build process that I cannot solve.

I would like to have this too for Defold to be honest!

Don’t you need to do that to build Godot? It looks like there are requirements that Visual Studio, GCC/clang, Python and SCons are installed.

Yes. That was a decision we made. Could we change it? Maybe? I don’t know the details.

What would you prefer?

Did you share the errors on Discord or something?

It generates if you build with --generate-compile-commands e.g

./scripts/build.py build_engine --platform=arm64-macos --skip-codesign --skip-tests --generate-compile-commands – --skip-build-tests

I found the build process too complicated.

One reason we don’t focus more on it, is that it works well enough currently, and we are a small team swamped with more attractive features for developers than build scripts. It’s a balance of course, and we’ll continue to work on the scripts/instructions when time allows. In the meantime, they do work!

You have to simplify the requirements - concrete compiler like clang, waf system and python when it could be a standard CMake build + python for complicated stuff. A lot of manual steps…

Not sure what the complaint about waf is here. It’s not the one I’d choose today, but it does work.
And not sure what the issue with Python is either, as you mention SCons as a better alternative (which is also Python based)

CMake is never going to happen.
We are looking into e.g. genie (or premake), but replacing the entire build system is a huge task, which we don’t prioritize at this moment. We’d like to do it step by step.

I have to install java, python, visual studio, clang and a lot more

Surely there are prerequisites in Godot as well?
Is Visual Studio handled by an install script?

I don’t understand “forced” here?
Yes, we use clang for all platforms except web (even windows on our Linux cloud builder). On those platforms, there are no alternatives!
Clang is a well known compiler, that has been around for many years.
While we still use cl.exe on local windows builds, that might very well change to clang in the future.
Currently though, we use it on local build machines for generating language bindings. I don’t think cl.exe can do that, and certainly not in a cross platform manner.

I am forced to use a simple text editor.

Well, you can use any editor, but I guess the comment is really about intelli sense and debuggability.
As mentioned, one helper command exist, which we certainly should promote better.
As for generating “IDE” projects, that’s why we’d like to move towards Genie, as it can help us do that.
When we’ll get time for it, we’ll see.

I am forced to use git-bash or otherwise nothing builds.

While not technically required, it’s the one we recommend, as it’s the only one we’ve found that properly give you a Unix-like prompt in Windows.
It totally helps us to only maintain bash scripts, without us also having to write batch script as well (with the odd exception).

I managed to compile and the tests started running there is still some error with the build process that I cannot solve.

Since you didn’t post anything more, I assumed it was all working for you.
We can’t help with a problem if you don’t mention it.

Best of luck in the future!

3 Likes

I am getting the same Waiting for the HTTP testserver to start error when building :thinking:

Waiting for HTTP testserver to start
Waiting for HTTP testserver to start
Waiting for HTTP testserver to start
HTTP server failed to start within 15 seconds
'.' is not recognized as an internal or external command,
operable program or batch file.

[exec] python I:\Workspace\Git\defold\tmp\dynamo_home/ext/bin/waf --prefix=I:\Workspace\Git\defold\tmp\dynamo_home distclean configure build install --platform=x86_64-win32
Error:
Traceback (most recent call last):
  File "I:\Workspace\Git\defold\scripts\build.py", line 2557, in <module>
    f()
  File "I:\Workspace\Git\defold\scripts\build.py", line 1253, in build_engine
    self._build_engine_lib(args, lib, host)
  File "I:\Workspace\Git\defold\scripts\build.py", line 1201, in _build_engine_lib
    run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)
  File "I:\Workspace\Git\defold\build_tools\run.py", line 98, in env_command
    return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)
  File "I:\Workspace\Git\defold\build_tools\run.py", line 75, in _exec_command
    raise e
run.ExecException: 1

Any tips on what to look out for to get this moving would be greatly appreciated :slight_smile:

EDIT: Not sure if it helps but I get a lot of:
LINK : warning LNK4044: unrecognized option '/O2'; ignored
and
I:\Workspace\Git\defold\engine\dlib\src\dmsdk\dlib\dalloca.h(33): warning C4005: 'alloca': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\malloc.h(176): note: see previous definition of 'alloca'

During the compilation

Could you please share the full log and the commands you run from the point where you open the shell?

I wonder if maybe it is a firewall which prevents the http server from launching? (It is used for tests).

Have you also tried running with tests disabled?

–skip-tests

I had tried disabling firewalls and antivirus just in case but no luck unfortunately. I had tried with --skip-tests too and had a separate issue (clang was not picked up, as suggested by someone at Discord) but updated PATH and that went ahead).

Now I run into the following when I try skip-tests. It goes further than before but struggles building jni:

Building jni for x86_64-win32
[exec] python I:\Workspace\Git\defold\tmp\dynamo_home/ext/bin/waf --prefix=I:\Workspace\Git\defold\tmp\dynamo_home --skip-tests distclean configure build install --platform=x86_64-win32
'distclean' finished successfully (0.001s)
Setting top to                           : I:\Workspace\Git\defold\engine\jni
Setting out to                           : I:\Workspace\Git\defold\engine\jni\build
Checking for program 'valgrind'          : not found
Checking for program 'ccache'            : not found
[exec] I:\Workspace\Git\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --sdk_root
[exec] I:\Workspace\Git\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --sdk_version
[exec] I:\Workspace\Git\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --includes
[exec] I:\Workspace\Git\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --lib_paths
[exec] I:\Workspace\Git\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --bin_paths
[exec] I:\Workspace\Git\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --vs_root
[exec] I:\Workspace\Git\defold\tmp\dynamo_home/../../scripts/windows/vswhere2/vswhere2.exe --vs_version
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe
Checking for program 'CL'                : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\CL.exe
Checking for program 'LINK'              : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\LINK.exe
Checking for program 'LIB'               : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\LIB.exe
Checking for program 'RC'                : C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\RC.exe
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe
Checking for program 'javac'             : C:\Program Files\Android\Android Studio\jbr\bin\javac.exe
Checking for program 'java'              : C:\Program Files\Android\Android Studio\jbr\bin\java.exe
Checking for program 'jar'               : C:\Program Files\Android\Android Studio\jbr\bin\jar.exe
Checking for program 'javadoc'           : C:\Program Files\Android\Android Studio\jbr\bin\javadoc.exe
Checking for program 'valgrind'          : not found
Checking for program 'ccache'            : not found
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe
Checking for program 'CL'                : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\CL.exe
Checking for program 'signtool'          : C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe
Checking for program 'javac'             : C:\Program Files\Android\Android Studio\jbr\bin\javac.exe
Checking for program 'java'              : C:\Program Files\Android\Android Studio\jbr\bin\java.exe
Checking for program 'jar'               : C:\Program Files\Android\Android Studio\jbr\bin\jar.exe
Checking for program 'javadoc'           : C:\Program Files\Android\Android Studio\jbr\bin\javadoc.exe
  src\test\jni/Testapi.empty.cpp => Testapi
Wrote src\test\java\com\dynamo\bob\pipeline/Testapi.java
Wrote src\test\jni/Testapi_jni.cpp
Wrote src\test\jni/Testapi_jni.h
'configure' finished successfully (0.864s)
Waf: Entering directory `I:\Workspace\Git\defold\engine\jni\build'
[ 1/14] Compiling src\jni\jni_util.cpp
[ 2/14] Compiling src\jni\jni_util.cpp
[ 3/14] Compiling src\test\jni\Testapi_jni.cpp
[ 4/14] Compiling src\test\testapi.cpp
[ 5/14] Compiling src\test\test_jni.cpp
[ 6/14] Compiling src\test\testapi.cpp
[ 7/14] Compiling src\test\test_jni.cpp
[ 8/14] Compiling src\test\jni\Testapi_jni.cpp
[ 9/14] Processing javac: src\test\java\com\dynamo\bob\pipeline\JniTest.java src\test\java\com\dynamo\bob\pipeline\Testapi.java
jni_util.cpp
I:\Workspace\Git\defold\engine\jni\src\jni\jni_util.h(22): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory

Testapi_jni.cpp
..\src\test\jni\Testapi_jni.cpp(3): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory

jni_util.cpp
I:\Workspace\Git\defold\engine\jni\src\jni\jni_util.h(22): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory

testapi.cpp
I:\Workspace\Git\defold\engine\jni\src\test\jni\Testapi_jni.h(3): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory

testapi.cpp
I:\Workspace\Git\defold\engine\jni\src\test\jni\Testapi_jni.h(3): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory

Testapi_jni.cpp
..\src\test\jni\Testapi_jni.cpp(3): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory

test_jni.cpp
I:\Workspace\Git\defold\engine\jni\src\jni/jni_util.h(22): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory

test_jni.cpp
I:\Workspace\Git\defold\engine\jni\src\jni/jni_util.h(22): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory

Picked up _JAVA_OPTIONS: -Xmx8g

Waf: Leaving directory `I:\Workspace\Git\defold\engine\jni\build'
Build failed
 -> task in 'jni_noasan' failed with exit status 2 (run with -v to display more information)
 -> task in 'test_jni' failed with exit status 2 (run with -v to display more information)
 -> task in 'jni' failed with exit status 2 (run with -v to display more information)
 -> task in 'test_jni' failed with exit status 2 (run with -v to display more information)
 -> task in 'test_jni_shared' failed with exit status 2 (run with -v to display more information)
 -> task in 'test_jni_shared' failed with exit status 2 (run with -v to display more information)
 -> task in 'test_jni' failed with exit status 2 (run with -v to display more information)
 -> task in 'test_jni_shared' failed with exit status 2 (run with -v to display more information)

[exec] python I:\Workspace\Git\defold\tmp\dynamo_home/ext/bin/waf --prefix=I:\Workspace\Git\defold\tmp\dynamo_home --skip-tests distclean configure build install --platform=x86_64-win32
Error:
Traceback (most recent call last):
  File "I:\Workspace\Git\defold\scripts\build.py", line 2557, in <module>
    f()
  File "I:\Workspace\Git\defold\scripts\build.py", line 1253, in build_engine
    self._build_engine_lib(args, lib, host)
  File "I:\Workspace\Git\defold\scripts\build.py", line 1201, in _build_engine_lib
    run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)
  File "I:\Workspace\Git\defold\build_tools\run.py", line 98, in env_command
    return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)
  File "I:\Workspace\Git\defold\build_tools\run.py", line 75, in _exec_command
    raise e
run.ExecException: 1

Thanks!

Hmm, ok, let’s wait and see what @JCash makes of this.

He’s helping me on Discord already :slight_smile:

As soon as we reach a conclusion I will update this thread for future reference for others in case they run into the same issues

I also checked in a fix on defold/dev branch for this.

As for the missing jni.h suggests that there is something wrong with the JDK.
In our install notes, we recommend using one of the open source versions of JDK (we have links for each platform).

In your configure step, you have an Android version, and I’m guessing that’s the issue:

Checking for program 'javac'             : C:\Program Files\Android\Android Studio\jbr\bin\javac.exe
Checking for program 'java'              : C:\Program Files\Android\Android Studio\jbr\bin\java.exe

Could you try using another JDK?

2 Likes

Yep - When we were talking about it on Discord I decided to try downloading one of your recommended open source versions of the JDK and it solved the problem.

Android Studio’s JDK did not include some of the dependencies the build process required.
That made it go past that stage (by skipping tests only - still didn’t get it working without skipping tests).

And for anyone who runs into these - these are the steps I needed to follow to build succesfully:

  • Make sure Clang is picked in your $PATH.
  • Install one of the recommended Open Source JDK and update $PATH to have that take priority (in case you had others like I did)
  • Upon building, you may run into other errors… Files that appear missing… Just try building again. That happened to me 2 or 3 times but building again would move onto the next one. And eventually complete the build :slight_smile:
1 Like