Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One more compiler problem: template<typename _N, typename T> #55

Open
DominikMS opened this issue Jun 7, 2014 · 7 comments
Open

One more compiler problem: template<typename _N, typename T> #55

DominikMS opened this issue Jun 7, 2014 · 7 comments

Comments

@DominikMS
Copy link

I can't compile your code in Android NDK, why? Look at this:

template<typename _N, typename T>
struct StateBinder
{
};

Throws error:

expected nested-name-specifier before numeric constant  main.cpp line 5 C/C++ Problem
expected '>' before numeric constant    main.cpp line 5 C/C++ Problem

But! This is working well:

template<typename N, typename T>
struct StateBinder
{
};

Difference? _ N changed to N (or to N_), why it happens?

@Tomasu
Copy link
Owner

Tomasu commented Jun 7, 2014

Does the android ndk support C++11? Also I can't imagine why it doesn't support an underscore on template parameter names.... it's a pretty common thing. I'll look into it.

@DominikMS
Copy link
Author

ndk supports c++11.
I had to change: _Ret, _Args, _N, _Class, _Type (and std::tuple from previous issue) and sources are compiled fine.

@Tomasu
Copy link
Owner

Tomasu commented Jun 7, 2014

I think that is incredibly strange. what version of gcc does it use? I really don't want to support gcc prior to 4.8. 4.7 and before are buggy and incomplete with C++11. I even got some pretty good internal compiler errors.

@DominikMS
Copy link
Author

I can see there is new update, i will download and check your sources again.

ps. it use 4.8

@DominikMS
Copy link
Author

ndk and cygwin updated, now i have new error code:

'_Class' has not been declared  LuaGlueProperty.h   /LuaGlue    line 211    C/C++ 
'_Type' was not declared in this scope  LuaGlueClass.h /LuaGlue line 305    C/C++ 

@Tomasu
Copy link
Owner

Tomasu commented Jun 7, 2014

Are you sure it isn't because of modifications you've made? I've gotten the examples to compile and run just fine on windows via msys2 and on linux. both gcc 4.8 (4.8.1 for msys2, and 4.8.3 on debian).

@Tomasu
Copy link
Owner

Tomasu commented Jun 7, 2014

Waaaiit, no, _N in LuaGlue is supposed to be an int. not a typename. the way I'm using it it absolutely has to be declared as an int, as using basic types instead of typename or class is treated specially by the compiler when used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants