zynaddsubfx / zyn-fusion-build

Build Scripts For Zyn-Fusion
Do What The F*ck You Want To Public License
122 stars 39 forks source link

Both Windows cross compiling and mingw64 compilation are failing #115

Closed rabidmachine9 closed 1 year ago

rabidmachine9 commented 1 year ago

I will try to be as fast as possible considering that this is actually 2 questions, msys2 mingw64 compilation ends with this error:

...
[ 40%] Building CXX object src/CMakeFiles/zynaddsubfx_core.dir/Containers/MultiPseudoStack.cpp.obj
[ 40%] Building CXX object src/CMakeFiles/zynaddsubfx_core.dir/DSP/AnalogFilter.cpp.obj
[ 41%] Building CXX object src/CMakeFiles/zynaddsubfx_core.dir/DSP/FFTwrapper.cpp.obj
[ 41%] Building CXX object src/CMakeFiles/zynaddsubfx_core.dir/DSP/Filter.cpp.obj
In file included from C:/msys64/home/kpatch/src/zyn-fusion-build/src/zynaddsubfx/src/DSP/Filter.cpp
24:
C:/msys64/home/kpatch/src/zyn-fusion-build/src/zynaddsubfx/src/Params/FilterParams.h:103:9: error:
int64_t' does not name a type
  103 |         int64_t last_update_timestamp; // timestamp of last update to this structure,
      |         ^~~~~~~
C:/msys64/home/kpatch/src/zyn-fusion-build/src/zynaddsubfx/src/Params/FilterParams.h:20:1: note: 'i
t64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   19 | #include "PresetsArray.h"
  +++ |+#include <cstdint>
   20 |
make[3]: *** [src/CMakeFiles/zynaddsubfx_core.dir/build.make:188: src/CMakeFiles/zynaddsubfx_core.dr/DSP/Filter.cpp.obj] Error 1
make[2]: *** [CMakeFiles/Makefile2:1346: src/CMakeFiles/zynaddsubfx_core.dir/all] Error 2
make[1]: *** [Makefile:146: all] Error 2
make[1]: Leaving directory '/home/kpatch/src/zyn-fusion-build/build/build-zynaddsubfx-windows-releae'
make: *** [Makefile.mingw64.mk:71: build_zynaddsubfx] Error 2 

I also tried to cross compile in an Arch Linux VM and got the following error:

...
config.status: creating Makefile
config.status: creating libuv.pc
config.status: executing depfiles commands
config.status: executing libtool commands
cd deps/libuv   && CC="" CCLD="" CXX="" AR="" LD=x86_64-w64-mingw32-gcc make
make[2]: Entering directory '/home/vagrant/src/zyn-fusion-build/src/mruby-zest-build/deps/libuv'
  CC       src/libuv_la-fs-poll.lo
In file included from src/win/internal.h:29,
                 from src/fs-poll.c:26:
src/win/winapi.h:4730:16: error: redefinition of 'struct _TCP_INITIAL_RTO_PARAMETERS'
 4730 | typedef struct _TCP_INITIAL_RTO_PARAMETERS {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/x86_64-w64-mingw32/include/ws2tcpip.h:265,
                 from ./include/uv/win.h:48,
                 from ./include/uv.h:64,
                 from src/fs-poll.c:22:
/usr/x86_64-w64-mingw32/include/mstcpip.h:163:16: note: originally defined here
  163 | typedef struct _TCP_INITIAL_RTO_PARAMETERS {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/win/winapi.h:4733:3: error: conflicting types for 'TCP_INITIAL_RTO_PARAMETERS'; have 'struct _TCP_INITIAL_RTO_PARAMETERS'
 4733 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/x86_64-w64-mingw32/include/mstcpip.h:166:3: note: previous declaration of 'TCP_INITIAL_RTO_PARAMETERS' with type 'TCP_INITIAL_RTO_PARAMETERS'
  166 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/win/winapi.h:4733:32: error: conflicting types for 'PTCP_INITIAL_RTO_PARAMETERS'; have 'struct _TCP_INITIAL_RTO_PARAMETERS *'
 4733 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/x86_64-w64-mingw32/include/mstcpip.h:166:32: note: previous declaration of 'PTCP_INITIAL_RTO_PARAMETERS' with type 'PTCP_INITIAL_RTO_PARAMETERS' {aka 'struct _TCP_INITIAL_RTO_PARAMETERS *'}
  166 | } TCP_INITIAL_RTO_PARAMETERS, *PTCP_INITIAL_RTO_PARAMETERS;
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:2394: src/libuv_la-fs-poll.lo] Error 1
make[2]: Leaving directory '/home/vagrant/src/zyn-fusion-build/src/mruby-zest-build/deps/libuv'
make[1]: *** [Makefile:78: deps/libuv-win.a] Error 2
make[1]: Leaving directory '/home/vagrant/src/zyn-fusion-build/src/mruby-zest-build'
make: *** [Makefile.windows.mk:132: build_zest] Error 2

I show some older comments that cross compilation needs a specific Ubuntu version. is this true and if it is which one should I use today ?

Thanks once more for any support!

fundamental commented 1 year ago

msys2 mingw64 compilation ends with this error:

I've heard a few reports of there being build issues with regards to uint8_t/int64_t/etc types. At least locally the extra header includes haven't been necessary, but some platforms are more strict than others when building. I'd imagine that it's only a few lines of code to restore the build in the msys2 environment and I've committed a fix for the specific error you've included.

I show some older comments that cross compilation needs a specific Ubuntu version. is this true and if it is which one should I use today ?

For whatever reason, the build environment for mingw varies quite a lot. The specific build environment I use comes from https://github.com/zynaddsubfx/zyn-fusion-build/blob/master/docker-builders/ubuntu-windows.dockerfile

If there's a problem with that, then a) that ought to be fixed and b) I should be able to hop into docker on my system to at least say which version of ubuntu my system was using.

rabidmachine9 commented 1 year ago

Thanks @fundamental :) I just managed to compile with your help! I had to include cstdint in a few more files and I just made a pull request

Thank you very much!

fundamental commented 1 year ago

Closing this issue as it was resolved thanks to that PR :)