My brother wrote a networking plugin (for 4.11 or something like that).
When I tried adding it to my 4.23 project I had to change many Engine related function calls but after hours of searching compilation still fails. The compile errors (100+) shown are only syntax errors in multiple .gen.cpp files. (By the way, I’d welcome advice on how to make UE4 C++ development less annoying)
Now the only and last clue is this warning here:
e:\program files\epic games\ue_4.23\engine\source\thirdparty\steamworks\steamv142\sdk\public\steam\steamtypes.h(99): warning C4005: 'ARRAY_COUNT': macro redefinition
All (I didn’t really check all) the syntax errors are either brackets or commas in lines where ARRAY_COUNT is indeed used.
I found this forum post where mordentral said:
The first error is another thing entirely though, steam appears to have a macro that is conflicting with an Unreal Engine macro. I looked it up and this was a problem before on visual studio but they merged a fix for it into the engine. I am directly accessing the file that caused the issue so it appears again when not using visual studio.
I included Epics #undef of the macro in my header as well, should fix it for you now. Hopefully I can remove that at some point though when / if either UE4 or Steamworks redefines that macro.
Also this forum post says to include and #undef in the files that reference the Engine like so:
#ifdef ARRAY_COUNT
#undef ARRAY_COUNT
#endif
I tried adding it to the file that references the steam API and the warning was gone but the errors where still there. Also OP didn’t have problems on Windows.
So how can I fix it? Is this even related to the ARRAY_COUNT macro?
I guess by now I might have even finished implementing this in BP…
Thanks in advance and cheers!
EDIT: Tried with steamworks version 139 and also updated to 146 with no changes.