I met "already defined error in AppDelegate.obj" with C++/cocos2dx.
This is my code in gamestage.h
#ifndef __GAME_STAGES_H__
#define __GAME_STAGES_H__
// stage 1;
namespace gamestage1
{
int btn_number = 9;
}
#endif
game.cpp and menu.cpp use this gamestage.h file and there are no gamestage.cpp file.
Actually, I tried to use extern like:
extern int btn_number = 9;
but It didn't work.
*What can cause this? *
__GAME_STAGES_H__) and names that begin with an underscore followed by a capital letter are reserved to the implementation. don't use them.extern int btn_number = 9;is a definition, even if it's markedextern.