Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
301 stars 53 forks source link

Failure at cross-compiling from Linux 32-bit to Windows 32-bit #3

Closed NeonKnightOA closed 4 years ago

NeonKnightOA commented 6 years ago

Using Linux Mint 17.3 Cinnamon. Have mingw32 installed.

I wanted to use the new, cool features in your version of NetRadiant, but cross-compiling to Win32 via mingw outputted the following error:

`i586-mingw32msvc-gcc tools/quake2/qdata/images.c  -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -fno-strict-aliasing -g -O -mms-bitfields -I/$HOME/netradiant-dependencies-mingw32/radiantdeps/include/libxml2   -Itools/quake2/common -Ilibs -Iinclude   -DWIN32 -D_WIN32 -D_inline=inline -I/$HOME/netradiant-dependencies-mingw32//radiantdeps/include -I/$HOME/netradiant-dependencies-mingw32//gtk/include -DRADIANT_VERSION="\"1.5.0n-git-e3d6c0a\"" -DRADIANT_MAJOR_VERSION="\"5\"" -DRADIANT_MINOR_VERSION="\"0\"" -DRADIANT_ABOUTMSG="\"Custom build\"" -DQ3MAP_VERSION="\"2.5.17n-git-e3d6c0a\"" -DRADIANT_EXECUTABLE="\"exe\""  -c -o tools/quake2/qdata/images.o`
`tools/quake2/qdata/images.c:1: error: stray ‘\357’ in program`
`tools/quake2/qdata/images.c:1: error: stray ‘\273’ in program`
`tools/quake2/qdata/images.c:1: error: stray ‘\277’ in program`
`In file included from tools/quake2/qdata/qdata.h:28,`
            `from tools/quake2/qdata/images.c:22:`
`tools/quake2/common/cmdlib.h:44: warning: ignoring #pragma intrinsic `
`make: *** [tools/quake2/qdata/images.o] Error 1`
`rm icons/q2map.rc`

I'm using a custom cross-compile file in order not to mess up with the one from the repo, which has this content:

`# Usage:`
`# copy this file to Makefile.conf`
`# edit the paths in here`

`# how to call the mingw tools`
`MINGW_EXEC_PREFIX = i586-mingw32msvc-`

`# use mingw32`
`include mingw-Makefile.inc`
`include mingw-radiantdeps-Makefile.inc`

How do I fix this?

Garux commented 6 years ago

That must be these unusual symbols in images.c stray357-273-277 del them? or just compile w/o qdata

NeonKnightOA commented 6 years ago

The hex-editing solved the problem! However, found another one.

'In file included from libs/gtkutil/window.h:29,'
    'from radiant/mainframe.h:25,'
    'from radiant/autosave.cpp:33:'
'libs/gtkutil/widget.h: In function ‘bool widget_is_visible(GtkWidget*)’:'
'libs/gtkutil/widget.h:35: error: ‘gtk_widget_get_visible’ was not declared in this scope'
'make: *** [radiant/autosave.o] Error 1'
'rm icons/h2data.rc icons/qdata3.rc icons/q3data.rc icons/q3map2.rc icons/q2map.rc'

And this time, hex-editing doesn't show anything.

Garux commented 6 years ago

Those hex EF BB BF were BOM :)

libs/gtkutil/window.h has

include <gtk/gtkwidget.h>

gtk/gtkwidget.h has gtk_widget_get_visible() (Since: 2.18) Probably you are using older GTK 2x or GTK3x, which only allows including gtk.h (and isn't supported) If older 2.x, GTK_WIDGET_VISIBLE(wid) macro may be used instead

I'm releasing windows builds from time to time btw: win32 build win64 build