TTimo / GtkRadiant

The open source, cross platform level editor for idtech games
http://icculus.org/gtkradiant/
Other
581 stars 152 forks source link

Doesn't Build On Compilers Which Default To C++17 #677

Open tekktonic opened 2 years ago

tekktonic commented 2 years ago

C++17 added a byte type which conflicts with GtkRadiant's.

The stdlib type isn't suitable for the way it's used here but it causes conflicts I think due to files including using std which pulls it in. There are a few options to fix this:

  1. Rename the type from byte
  2. Remove all relevant use of using std so that std::byte no longer conflicts
  3. Rewrite the relevant parts to just use std::byte
  4. Compile against C++11.

I've attached a patch which does #4 as a temporary fix because creating a fork for a 1 line change is silly. It's "a .txt" because github refuses to let you attach .patch files. std.txt

doggodanubus commented 2 years ago

Thanks for the patch. It's gotten past the byte failure. I could not run the predisastered binary as it was linked against some pangox binary library that doesn't exist on Fedora.

Now when I run it I get an error

No games setup, aborting

Will look at the code. :/

tkoeppe commented 2 years ago

How hard would option 2 be, removing those using-directives?

wdoekes commented 2 years ago

Here's an alternate fix:

https://github.com/wdoekes/gtkradiant-deb/blob/main/patches/radiant-fix-std-bool-std-byte.patch

dsvensson commented 1 year ago

Removed the typedef qboolean bool to get it to compile, and then the "No games setup, aborting" here as well. Would be nice with some docs on the next steps, is it some initialization that the packaged version does automatically that's needed? Alternatively a Flatpak to avoid having to build it to be compatible with recent version of whatever libs in dist.

There is an old Flatpak setup here, but abandoned since 2018, would be sweet to have it mainlined, https://github.com/magicmyth/io.github.TTimo.GtkRadiant

Oh, turns out that a symlink like installs -> ../../../install/installs in build/release/radiant makes it start. After configuring for Quake 1 engine it however fails on synapse after having loaded build/release/radiant/installs/Q1Pack/game/synapse.config. This is fixed by adding a symlink for modules -> ../../../install/modules in that same directory.

kungfooman commented 1 year ago

Hi @dsvensson, thank you for sharing the symlink trick! I was running into the same issue and now I realized that it is enough to simply start it via ~/GtkRadiant/install/radiant.bin:

image

Did you test that before?

@wdoekes Thank you for the patch, exactly my compilation error that I had to fix aswell.