You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have managed to compile the latest commit (at time of writing: 122fe39) under both Windows and Linux, but not without modification.
The issues I found and had to fix are as follows:
Windows/MSVC
https://github.com/Xrysnow/cocos2d-x-gfx and https://github.com/Xrysnow/lstgx_external/tree/master/yasio/src/yasio fail to compile thanks to windef.h's definition of min/max macros.
I just did some substitution to replace any instance of <...>::max( with (<...>::max)( (same with min).
I used this regex in VS Code to accomplish it: find ([^-{(\s]*)::m([ai][xn])\( replace ($1::m$2)(
There is a define, NOMINMAX, that you could use, but I don't know where to put it for these.
https://github.com/NanoMichael/MicroTeX fails to compile because DEBUG is a macro under MSVC.
What I did was rename Box::DEBUG to Box::ENABLE_DEBUG in this case.
I discovered this hack through your issue on this repo (Conflict with some macros NanoMichael/MicroTeX#44), so I guess you're aware of it.
You may want to just depend on your own fork instead at this point.
Linux/GCC
https://github.com/Xrysnow/cocos2d-x-gfx/blob/main/backend/gfx-base/GFXDef-common.h#L123 fails because of lines 123-128.
I actually don't know what's wrong with these lines but I'm assuming that Status is some predefined macro under GCC like min/max/DEBUG on MSVC as seen before. If someone could tell me why, that would be much appreciated. Until then, commenting out these lines works.
I was able to reproduce the bug described on Windows, and confirm that the fix does work. For convenience I will put the steps I used to build below (with windows powershell):
git clone --recursive https://github.com/Xrysnow/LuaSTG-x.git
cd LuaSTG-x/frameworks/cocos2d-x/external
git clone --recursive https://github.com/Xrysnow/cocos2d-x-3rd-party-libs-bin.git
move .\cocos2d-x-3rd-party-libs-bin\* .
rm -r -Force cocos2d-x-3rd-party-libs-bin
cd ../../..
mkdir win32-build
cd win32-build
# now in the main LuaSTG-x directory go into CMakeLists.txt and set No_LIVE2D flag to ON
cmake .. -G "Visual Studio 16 2019" -A Win32
Now replace all min/max in the entire solution as specified by @Tru-Dev 's steps, manually take care of a few (3) lines that the parenthesis are not added correctly.
Afterwards I run
cmake --build . --config Release
dll and exe files are successfully built. (and after replacing and modifying some files in a previous release the game is runnable)
I've got a fish script at Ravenclaw-OIer/getLuaSTG, which auto fixes at least some of the problems (as I built it in April). Also refer to #11 for some of my notes on GNU/Linux compilation.
I have managed to compile the latest commit (at time of writing: 122fe39) under both Windows and Linux, but not without modification.
The issues I found and had to fix are as follows:
Windows/MSVC
windef.h
's definition ofmin
/max
macros.I just did some substitution to replace any instance of
<...>::max(
with(<...>::max)(
(same with min).I used this regex in VS Code to accomplish it: find
([^-{(\s]*)::m([ai][xn])\(
replace($1::m$2)(
There is a define,
NOMINMAX
, that you could use, but I don't know where to put it for these.DEBUG
is a macro under MSVC.What I did was rename
Box::DEBUG
toBox::ENABLE_DEBUG
in this case.I discovered this hack through your issue on this repo (Conflict with some macros NanoMichael/MicroTeX#44), so I guess you're aware of it.
You may want to just depend on your own fork instead at this point.
Linux/GCC
I actually don't know what's wrong with these lines but I'm assuming that
Status
is some predefined macro under GCC likemin
/max
/DEBUG
on MSVC as seen before. If someone could tell me why, that would be much appreciated. Until then, commenting out these lines works.return (void*)glfwGetX11Window(_mainWindow);
and it works again.#include <cstring>
somewhere at the top.Box2D/Box2D.h
tobox2d/box2d.h
, because Linux is strict on capitalization.I did not test Mac compilation because I do not have a Mac, but if Mac compilation didn't work before it should work now...
The text was updated successfully, but these errors were encountered: