Garux / netradiant-custom

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

Fails to link on macOS Catalina 10.15.3 #40

Closed cu-kai closed 4 years ago

cu-kai commented 4 years ago

I have tried to compile this on macOS 10.15.3 and am encountering multiple errors;

tools/quake3/common/vfs.h:39:10: fatal error: 'linux/limits.h' file not found This one is easily fixable, by changing linux/limits.h to just limits.h

After fixing that, it will build but fail to link with the following error:

Undefined symbols for architecture x86_64:
  "_stricmp", referenced from:
      _PC_PushScript in l_precomp.o
      _PC_Directive_include in l_precomp.o
      _LoadCfgFile in aas_cfg.o
      _OutputFile in bspc.o
      _CreateAASFilesForAllBSPFiles in bspc.o
      _main in bspc.o
      _QuakeFileExtensionType in l_qfiles.o
      ...
     (maybe you meant: _Q_stricmp)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [install/mbspc.x86_64] Error 1

I am using brew to install my dependencies, and they are all up to date.

Garux commented 4 years ago

Hi. This has not been tested in mac for a long time, it would be cool to get some working build. Recent commit ought to deal with named issues, though idk if this will burn well https://github.com/Garux/netradiant-custom/blob/85e5807397d45a5b54ac2e078bde3b32d39ffd62/tools/mbspc/mbspc/qbsp.h#L49-L51

cu-kai commented 4 years ago

Hi Garux, thanks.

It's still failing to build with the same error.

cu-kai commented 4 years ago

I looked further at this, did you not mean #if defined __APPLE__ instead?

I tried changing the code and now instead get this error:

radiant/mainframe.cpp:684:67: error: use of undeclared identifier 'environ'

Garux commented 4 years ago

Googled and added 'environ' workaround.

cu-kai commented 4 years ago

We're getting there. Now running into the error I remember from trying to compile this years ago, and I don't remember how it was fixed. I have gtkglext.

radiant/qgl.cpp:58:10: fatal error: 'gdk/gdkx.h' file not found

Garux commented 4 years ago

Here are related discussions https://gitlab.com/xonotic/netradiant/-/issues/97 https://gitlab.com/xonotic/netradiant/-/issues/49

All related commits which i can find just remove this inclusion.

cu-kai commented 4 years ago

Yes, sadly that particular repo no longer builds properly on macOS and this is the only one I remember being able to build in recent months.

It's rather frustrating, however I have now managed to build this repo with an install of MacPorts, although this is not an ideal situation as everything else I use requires brew. On a side note, is there something I'm missing to fix these characters not showing?

From previous discussions with @illwieckz it looks like brew's gtkglext is still incomplete.

It may, in which case, be worth notice in COMPILING that the homebrew method is likely to fail.

I suppose, in this case, it may be worth closing this issue unless you really want brew builds fixed. I did build netradiant from xonotic's repo a few days ago but there were massive issues with the UI (see: https://cdn.discordapp.com/attachments/487358377333358612/694210639790604439/unknown.png) hence why I came back here to try and get this working.

Garux commented 4 years ago

I'm up to fixing, what is possible, let's get in touch in discord for faster communication (niger#7855).

Garux commented 4 years ago

COMPILING info is updated, font issue was solved by providing configs to fontconfig library.

illwieckz commented 4 years ago

For more information and after some tests with cu-kai, it looks like the only validated way to build netradiant and run it today successfully is to build it with macports and xquartz.

Building with homebrew and without xquartz will provide this visual garbage (previous screenshot by cu-kai) because the non-Xquartz GtkGlExt is incomplete:

netradiant gtkglext mistake

It exists some patch for GtkGlExt but while netradiant may display things right, crashes are experienced on some input, making it unuseable. A port to GTK3 with GtkGlArea may make life easier for anyone.