GtkRadiant icon indicating copy to clipboard operation
GtkRadiant copied to clipboard

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

Open tekktonic opened this issue 3 years ago • 5 comments

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

tekktonic avatar Jan 12 '22 21:01 tekktonic

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. :/

doggodanubus avatar May 30 '22 22:05 doggodanubus

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

tkoeppe avatar May 30 '22 23:05 tkoeppe

Here's an alternate fix:

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

wdoekes avatar Jun 05 '22 16:06 wdoekes

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.

dsvensson avatar Aug 16 '22 20:08 dsvensson

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.

kungfooman avatar Dec 19 '22 15:12 kungfooman