3.0 beta版本 引用gui出错

只是空项目,就引用了gui头文件就报导入函数出错。。。。求破啊。。。


#include "HelloWorldScene.h"
#include "CocosGUI.h"
#include "cocostudio\CocoStudio.h"
#include "cocosbuilder\CocosBuilder.h"

USING_NS_CC;

Scene* HelloWorld::createScene()
{
    // 'scene' is an autorelease object
    auto scene = Scene::create();
    
    // 'layer' is an autorelease object
    auto layer = HelloWorld::create();

    // add layer as a child to scene
    scene->addChild(layer);

    // return the scene
    return scene;
}

// on "init" you need to initialize your instance
bool HelloWorld::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Layer::init() )
    {
        return false;
    }
    
    Size visibleSize = Director::getInstance()->getVisibleSize();
    Point origin = Director::getInstance()->getVisibleOrigin();

    /////////////////////////////
    // 2. add a menu item with "X" image, which is clicked to quit the program
    //    you may modify it.

    // add a "close" icon to exit the progress. it's an autorelease object
    auto closeItem = MenuItemImage::create(
                                           "CloseNormal.png",
                                           "CloseSelected.png",
                                           CC_CALLBACK_1(HelloWorld::menuCloseCallback, this));
    
    closeItem->setPosition(Point(origin.x + visibleSize.width - closeItem->getContentSize().width/2 ,
                                origin.y + closeItem->getContentSize().height/2));

    // create menu, it's an autorelease object
    auto menu = Menu::create(closeItem, NULL);
    menu->setPosition(Point::ZERO);
    this->addChild(menu, 1);

    /////////////////////////////
    // 3. add your codes below...

    // add a label shows "Hello World"
    // create and initialize a label
    
    auto label = LabelTTF::create("Hello World", "Arial", 24);
    
    // position the label on the center of the screen
    label->setPosition(Point(origin.x + visibleSize.width/2,
                            origin.y + visibleSize.height - label->getContentSize().height));

    // add the label as a child to this layer
    this->addChild(label, 1);

    // add "HelloWorld" splash screen"
    auto sprite = Sprite::create("HelloWorld.png");

    // position the sprite on the center of the screen
    sprite->setPosition(Point(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));

    // add the sprite as a child to this layer
    this->addChild(sprite, 0);
    
    return true;
}


void HelloWorld::menuCloseCallback(Object* pSender)
{
    Director::getInstance()->end();

#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    exit(0);
#endif
}


1>------ 已启动全部重新生成:  项目: test, 配置: Debug Win32 ------
1>  AppDelegate.cpp
1>  HelloWorldScene.cpp
1>  main.cpp
1>  复制了 2 个文件
1>AppDelegate.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/SAFESEH”规范)
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: 默认库“libcmt.lib”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: 默认库“libcmtd.lib”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: 默认库“msvcrt.lib”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
1>HelloWorldScene.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall cocos2d::gui::Margin::Margin(void)" (??0Margin@gui@cocos2d@@QAE@XZ),该符号在函数 "void __cdecl cocos2d::gui::`dynamic initializer for 'MarginZero''(void)" (??__EMarginZero@gui@cocos2d@@YAXXZ) 中被引用
1>E:\game\test\proj.win32\Debug.win32\test.exe : fatal error LNK1120: 1 个无法解析的外部命令
========== 全部重新生成:  成功 0 个,失败 1 个,跳过 0 个 ==========

链接错误:
你添加下面的库试试:
Linker 设置

$(EngineRoot)build\Debug.win32
如果是release 需要设置release相应的目录

链接中却少相应的 lib库

libGUI.lib
libCocosStudio.lib
libExtensions.lib

在这里已经找到答案了
http://http://www.qp169.com/function/67