OpenAG icon indicating copy to clipboard operation
OpenAG copied to clipboard

build fails on linux

Open Glitch31415 opened this issue 1 year ago • 15 comments

└─$ cmake --build . --config Release      
[  1%] Building CXX object external/discord-rpc/src/CMakeFiles/discord-rpc.dir/discord_rpc.cpp.o
In file included from /home/glitch/OpenAG/external/discord-rpc/src/serialization.h:15,
                 from /home/glitch/OpenAG/external/discord-rpc/src/rpc_connection.h:4,
                 from /home/glitch/OpenAG/external/discord-rpc/src/discord_rpc.cpp:6:
/home/glitch/OpenAG/external/discord-rpc/thirdparty/rapidjson-1.1.0/include/rapidjson/document.h: In member function ‘rapidjson::GenericStringRef<CharType>& rapidjson::GenericStringRef<CharType>::operator=(const rapidjson::GenericStringRef<CharType>&)’:
/home/glitch/OpenAG/external/discord-rpc/thirdparty/rapidjson-1.1.0/include/rapidjson/document.h:319:82: error: assignment of read-only member ‘rapidjson::GenericStringRef<CharType>::length’
  319 |  operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
      |                                                      ~~~~~~~^~~~~~~~~~~~

At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-global-constructors’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-exit-time-destructors’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-covered-switch-default’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-c++98-compat-pedantic’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-c++98-compat’ may have been intended to silence earlier diagnostics
gmake[2]: *** [external/discord-rpc/src/CMakeFiles/discord-rpc.dir/build.make:79: external/discord-rpc/src/CMakeFiles/discord-rpc.dir/discord_rpc.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:335: external/discord-rpc/src/CMakeFiles/discord-rpc.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

Glitch31415 avatar Dec 13 '24 06:12 Glitch31415

Yeah, a compiler update now catches this problem in old rapidjson bundled by old discord-rpc... Not sure what's the best way to deal with it, maybe somehow bundle discord-rpc and its rapidjson in the OpenAG repo with a fix?

For now you can just change that file locally to make the length member not const.

YaLTeR avatar Dec 13 '24 06:12 YaLTeR

what should i change it to? i deleted the const on both of them and it errored

Glitch31415 avatar Dec 13 '24 06:12 Glitch31415

is there a way to build it without rich presence? i don't use that feature

Glitch31415 avatar Dec 13 '24 06:12 Glitch31415

On line 325 in document.h change const SizeType length; to SizeType length;

YaLTeR avatar Dec 13 '24 06:12 YaLTeR

thanks, the rest of the build worked

Glitch31415 avatar Dec 13 '24 06:12 Glitch31415

should probably leave this open

Glitch31415 avatar Dec 13 '24 06:12 Glitch31415

@YaLTeR where can i find the latest ag.7z? is the one from openag.pro the latest?

Glitch31415 avatar Dec 13 '24 06:12 Glitch31415

Yes

YaLTeR avatar Dec 13 '24 06:12 YaLTeR

alr, i have it installed, am i able to join normal half-life community servers? or only openAG servers? Screenshot from 2024-12-12 23-03-59

Glitch31415 avatar Dec 13 '24 07:12 Glitch31415

Only AG servers.

YaLTeR avatar Dec 13 '24 07:12 YaLTeR

If you move client.dll/.so to the "valve_addon/cl_dlls" directory and enable custom addon content in video options (_setaddons_folder 1 does the thing too after restarting), then you'll be able to play HLDM with OpenAG client. Of course you need to play in "valve" gamedir, not "ag" one.

ScriptedSnark avatar Dec 13 '24 08:12 ScriptedSnark

You can also play on HLDM servers without swapping out the client, directly from AG. The catch is that the server needs to be running on a reHLDS version that's recent enough.

Simply set setinfo _gd ag and you will be able to join valve servers. Note that it has to be the gamedir you are on (ag) and not the one you're trying to join. Can be a little counter-intuitive.

execut4ble avatar Dec 13 '24 08:12 execut4ble

^

But you already need to know IPs of servers which support that feature. Also most of HLDM servers are on vanilla HLDS or on older ReHLDS versions.

ScriptedSnark avatar Dec 13 '24 08:12 ScriptedSnark

alr, so just find ips on gametracker and see if they work?

Glitch31415 avatar Dec 13 '24 09:12 Glitch31415

Pretty much.

The relevant reHLDS patch https://github.com/rehlds/ReHLDS/commit/0c5ce53666811c4243ed5aa0c755dab26d2283d4 has been out since last year, so if the server owners have updated reHLDS since then, it's likely you'll be able to join the server this way.

execut4ble avatar Dec 13 '24 12:12 execut4ble