Hello guys!
I’m learning to use GUI on cocos2d-x, when i use VS2012 to run win32 app, its work fine.
(i add libGUI, libCocosStudio and libExtensions to VS)
But i got problem when i ran this project on Eclipse.
it show an error on MyProject/cocos2d/cocos/ui/GUIDefine.h file:
“fatal error: cocostudio/ObjectFactory.h: No such as file or directory”
in line “#include “cocostudio/ObjectFactory.h””
i don’t know how to import that library to eclipse.
Help me plz.
sorry for my bad english.
Thanks
Well,
After i add following line to Android.mk file, its work fine
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
$(call import-module,editor-support/cocostudio)
$(call import-module,extensions)
sorry, but could you please elaborate how you added those line to the android.mk file?
I’m getting the precisely same error, but when I added those line the error still persists.
And how do you use your include? The library I’m including is UIButton.h, so I include it like:
#include “ui/UIButton.h”
I use it like that and still get the error. Thank you
When you add libraries like libGUI, libCocosStudio, libExtensions you must:
-
On Visual Studio: File => add Existing Project. Then choose 3 libraries:
…\cocos2d\cocos\ui\proj.win32\libGUI
…\cocos2d\cocos\editor-support\cocostudio\proj.win32\libCocosStudio
…\cocos2d\extensions\proj.win32\libExtensions
Then in Properties => C\C++ => General => Additisional Include Directory:
add values:
$(EngineRoot)cocos\
$(EngineRoot)cocos\editor-support
After all, add following line to Android.mk file
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
$(call import-module,editor-support/cocostudio)
$(call import-module,extensions)
In some cases you must add line $(EngineRoot) on step 2.
use namespace USING_NS_CC; after #include"someLib"
Hope this help.