USER FORUM
(you are viewing a thread; or go back to list of threads)
Trying to build Windows binary from source (by Ante)
I would like tro try out a more recent version than the last release. Trying to build a Windows binary from source (under Ubuntu 18.04.1). Building either 32-bit or 64-bit gives me this error. Any ideas?
...
[ 13%] Building CXX object extlib/flatbuffers/CMakeFiles/flatc.dir/grpc/src/compiler/go_generator.cc.obj
[ 13%] Building CXX object extlib/flatbuffers/CMakeFiles/flatc.dir/grpc/src/compiler/java_generator.cc.obj
[ 13%] Linking CXX executable ../../bin/flatc.exe
[ 13%] Built target flatc
Scanning dependencies of target q3d_header
[ 13%] Generating q3d_object_generated.h
/bin/sh: 1: ../../bin/flatc.exe: Exec format error
extlib/q3d/CMakeFiles/q3d_header.dir/build.make:60: recipe for target 'extlib/q3d/q3d_object_generated.h' failed
make[2]: *** [extlib/q3d/q3d_object_generated.h] Error 2
CMakeFiles/Makefile2:224: recipe for target 'extlib/q3d/CMakeFiles/q3d_header.dir/all' failed
make[1]: *** [extlib/q3d/CMakeFiles/q3d_header.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
...
[ 13%] Building CXX object extlib/flatbuffers/CMakeFiles/flatc.dir/grpc/src/compiler/go_generator.cc.obj
[ 13%] Building CXX object extlib/flatbuffers/CMakeFiles/flatc.dir/grpc/src/compiler/java_generator.cc.obj
[ 13%] Linking CXX executable ../../bin/flatc.exe
[ 13%] Built target flatc
Scanning dependencies of target q3d_header
[ 13%] Generating q3d_object_generated.h
/bin/sh: 1: ../../bin/flatc.exe: Exec format error
extlib/q3d/CMakeFiles/q3d_header.dir/build.make:60: recipe for target 'extlib/q3d/q3d_object_generated.h' failed
make[2]: *** [extlib/q3d/q3d_object_generated.h] Error 2
CMakeFiles/Makefile2:224: recipe for target 'extlib/q3d/CMakeFiles/q3d_header.dir/all' failed
make[1]: *** [extlib/q3d/CMakeFiles/q3d_header.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
(no subject) (by Mike O)
Are you using a cross-compiler ? Can't tell from the output above. Not sure how familiar you're with the topic, so I will just point out the obvious: you can't generate Windows binaries on Linux without using
1) compiler for the target platform (cross-compiler)
2) having all dependencies cross-compiled as well
Given it's a lot more tricky to cross-compile stuff, I'd recommend just getting a Windows environment with cygwin or similar, and compiling it on the target. Otherwise take a look at this and related Ubuntu packages :
gcc-mingw-w64-x86-64/xenial 5.3.1-8ubuntu3+17 amd64
GNU C compiler for MinGW-w64 targeting Win64
1) compiler for the target platform (cross-compiler)
2) having all dependencies cross-compiled as well
Given it's a lot more tricky to cross-compile stuff, I'd recommend just getting a Windows environment with cygwin or similar, and compiling it on the target. Otherwise take a look at this and related Ubuntu packages :
gcc-mingw-w64-x86-64/xenial 5.3.1-8ubuntu3+17 amd64
GNU C compiler for MinGW-w64 targeting Win64
(no subject) (by Ante)
Thanks for the resply. My bad. Should have written that I followed the instruction "Building on Linux: Building for Windows"
https://github.com/solvespace/...README.md#building-for-windows
https://github.com/solvespace/...README.md#building-for-windows
(no subject) (by Mike O)
Ah, makes sense now. I tried those instructions, and I think it got a lot further than yours, but broke later on some known (according to Google) problem with mingw and DirectX.
Post a reply to this comment: