CNMAT / CNMAT-Externs

CNMAT Max/MSP externals
Other
96 stars 11 forks source link

Windows build fails at OSC-Client.o #136

Closed wagne342 closed 2 years ago

wagne342 commented 2 years ago

The current build system under Cygwin fails for objects with dependencies in core gcc. The "no such file" error on arpa/inet.h is due to its absence from /usr/x86_64-w64-mingw32/sys-root/mingw/include. arpa/inet.h is present at /usr/include, but apparently not compatible with mingw. This must have worked in the past. I suspect changes in Cygwin packages have broken this. Looking for a workaround.

x86_64-w64-mingw32-gcc -DWIN_VERSION -DWIN_EXT_VERSION -U__STRICT_ANSI__ -U__ANSI_SOURCE -std=c99 -O3 -DNO_TRANSLATION_SUPPORT -msse3 -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I../max-sdk-base/c74support/max-includes -Iinclude -I../max-sdk-base/c74support/msp-includes -Ilib -Ilib/Jehan-lib -I../max-sdk-base/c74support/jit-includes -I../CNMAT-OSC/OSC-Kit -I../CNMAT-OSC/libOSC -I../CNMAT-SDIF/lib -Isrc/SDIF-Buffer -Iutility-library/search-path -I../libo -I../libomax -c -o build/Release/OSC-client.o ../CNMAT-OSC/libOSC/OSC-client.c ../CNMAT-OSC/libOSC/OSC-client.c:55:2: warning: #warning Congratulations on your good taste in choosing to compile Windows Max/MSP externals with GCC! [-Wcpp] 55 | #warning Congratulations on your good taste in choosing to compile \ | ^~~~~~~ ../CNMAT-OSC/libOSC/OSC-client.c:61:10: fatal error: arpa/inet.h: No such file or directory 61 | #include <arpa/inet.h> // htonl | ^~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:117: build/Release/OSC-client.o] Error 1

wagne342 commented 2 years ago

@ramagottfried have you run into this before?

maccallum commented 2 years ago

@wagne342 I've moved all my Windows dev over to MSYS2. I'm not sure if it'll fix this issue, but it fixed a number of other build issues I was having a while back.

wagne342 commented 2 years ago

@maccallum I've tried building on MSYS2 as well, but it doesn't support certain socket headers required by some of our objects, so several objects like SlipOSC, OpenSoundControl, etc.can't be built with it unless we do some major/minor surgery on some of the older dependencies. I suspect this is why Cygwin was chosen in the first place. Cygwin provides POSIX wrappers that allow imports of arpa/.. headers and a few others that mingw doesn't support. MSYS2 is clearly a preferable build environment. I suppose the long term solution is to update CNMAT-OSC to more current practice, so it may be time for that.

maccallum commented 2 years ago

Just to make sure, you tried MSYS2, and not MSYS, right?

On Apr 9, 2022, at 3:41 PM, Jeremy Wagner @.***> wrote:

I've tried building on Msys as well, but it doesnt support certain socket programming headers required by some of our objects (the ones causing the above error, in fact), so several objects with those dependencies can't be built with it unless we do some major/minor surgery on some of the older dependencies. I suspect this is why Cygwin was chosen in the first place. It provides POSIX wrappers that allow imports of arpa/.. headers and a few others that mingw doesn't support. But now this is precisely where Cygwin is failing. Msys is clearly the better option if we could make it work.

On Fri, Apr 8, 2022, 11:46 PM John MacCallum @.***> wrote:

@wagne342 https://github.com/wagne342 I've moved all my Windows dev over to MSYS2. I'm not sure if it'll fix this issue, but it fixed a number of other build issues I was having a while back.

— Reply to this email directly, view it on GitHub https://github.com/CNMAT/CNMAT-Externs/issues/136#issuecomment-1093750824, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGWSI7IKGKXEG5ZDPE7CM3VEERTZANCNFSM5S5BHRQA . You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/CNMAT/CNMAT-Externs/issues/136#issuecomment-1094031920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOG5PYJYBZEEQOH2RHPQDVEGCKJANCNFSM5S5BHRQA. You are receiving this because you commented.

wagne342 commented 2 years ago

@maccallum nearly certain I used MSYS2, but will check tomorrow morning when I get back to that machine. The root issue is the lack of support for the following headers in MSYS2:

arpa/inet.h winsock2.h ...and upstream dependencies in /sys

https://packages.msys2.org/search?t=pkg&q=arpa%2Finet.h

ramagottfried commented 2 years ago

hi @wagne342 I'm not sure, the last time I built on Windows was quite a while back, but I do see that I merged a pull request in the CNMAT-OSC repository more recently that added the arpa/inet.h include >> link -- Adrian gave the approval for the merge request, but I didn't test it myself. Maybe try rolling back the merge and see if it fixes the problem? then we should probably re-add the pull request as per Adrian's wishes -- but maybe it needs some testing first, not sure.

wagne342 commented 2 years ago

Found the problem. The import added in the last merge to CNMAT-OSC is causing the problem. I have addressed it there. Now works on all platforms.