OryolMain macro doesn't compile when called as Oryol::OryolMain
steadysupply opened this issue · 1 comments
Hello,
First off, thanks for making Oryol, it looks really great for my purposes (develop cross platform C++ apps for mobile, not being forced to use a particular IDE).
🎉 👌
I started by following fips progress video #7: building standalone apps but ran into some errors before realising the video was a few years old, so instead ended up cloning oryol-samples
repo and using that as a base. Things are working pretty nicely, apart from I wanted to be explicit about namespaces and have Oryol::
prefix so I can easily tell where functions come from, but this caused an error in the OryolMain
macro in code/Modules/Core/Main.h
.
Here's the error:
In file included from /home/ben/work/oryol/oryol-base/src/Base.cc:5:0:
/home/ben/work/oryol/oryol/code/Modules/Core/Main.h:61:1: error: ‘Oryol’ in namespace ‘Oryol’ does not name a type
Oryol::Args OryolArgs; \
^
/home/ben/work/oryol/oryol-base/src/Base.cc:24:8: note: in expansion of macro ‘OryolMain’
Oryol::OryolMain(BaseApp);
^~~~~~~~~
/home/ben/work/oryol/oryol-base/src/Base.cc: In function ‘int main(int, const char**)’:
/home/ben/work/oryol/oryol/code/Modules/Core/Main.h:63:5: error: ‘OryolArgs’ was not declared in this scope
OryolArgs = Oryol::Args(argc, argv); \
^
/home/ben/work/oryol/oryol-base/src/Base.cc:24:8: note: in expansion of macro ‘OryolMain’
Oryol::OryolMain(BaseApp);
^~~~~~~~~
/home/ben/work/oryol/oryol/code/Modules/Core/Main.h:63:5: note: suggested alternative: ‘OryolMain’
OryolArgs = Oryol::Args(argc, argv); \
^
/home/ben/work/oryol/oryol-base/src/Base.cc:24:8: note: in expansion of macro ‘OryolMain’
Oryol::OryolMain(BaseApp);
^~~~~~~~~
I realised after that I can still refer to Oryol functions using the Oryol::
namespace when I am already using namespace Oryol
, so this isn't really an issue, but I have to call OryolMain
not Oryol::OryolMain
.
Cheers,
Ben
Ah, sorry for not responding earlier, somehow the notification must have slipped through. Yeah, the problem is that OryolMain() is a macro and that can't be wrapped in a namespace :)