Hi,
So I made a project with cocos console tool, v3.2.
Now I want to add a few ui elements (ScrollView, Button, etc…) to a layer…
So I added #include "ui/UIScrollView.h"
at the top and later on instantiate it auto scrollView = ui::ScrollView::create();
But it doesn’t compile (win32 proj with msvs 2010), failing at the linkage:
Error 5 error LNK2019: unresolved external symbol "public: static class cocos2d::ui::ScrollView * __cdecl cocos2d::ui::ScrollView::create(void)" (?create@ScrollView@ui@cocos2d@@SAPAV123@XZ) referenced in function "public: virtual bool __thiscall MainMenu::init(void)" (?init@MainMenu@@UAE_NXZ) C:\Projects\Kamebu\proj.win32\MainMenu.obj
Error 6 error LNK2019: unresolved external symbol "public: void __thiscall cocos2d::ui::ScrollView::setBounceEnabled(bool)" (?setBounceEnabled@ScrollView@ui@cocos2d@@QAEX_N@Z) referenced in function "public: virtual bool __thiscall MainMenu::init(void)" (?init@MainMenu@@UAE_NXZ) C:\Projects\Kamebu\proj.win32\MainMenu.obj
Why is it happening?..
Maybe newly created project with cocos tool doesn’t have a ui components wired by default? Is it ok to use ui components for a cross-platform development or maybe there is some other hidden obstacles to be considered?
Regards,
Mike.