首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于未定义符号,cocos2dx构建失败

由于未定义符号,cocos2dx构建失败
EN

Stack Overflow用户
提问于 2016-07-18 14:45:41
回答 1查看 1.8K关注 0票数 0

我是Cocos2d和Xcode的新手(以及游戏开发和mac,我是window和eclipse用户)。我在coco2dx主页上做programmer guide的工作。我已经克隆了git并尝试运行代码,但我遇到了libcocos2d iOS.a的编译错误。我设置了库路径(到libcocos2d)和头文件,这导致了"cocos2d.h not found“错误。但是现在我遇到了一个链接器错误的问题。我用谷歌搜索了一下构建架构的错误,但没有找到好的东西。我当前对构建体系结构的构建设置是:是调试,否发布,体系结构设置为标准64位x86_64,有效的体系结构是-armv7、armv7s、i386、x86_64和arm64-这方面有什么帮助吗?

代码语言:javascript
复制
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_CMMotionManager", referenced from:
      objc-class-ref in libcocos2d iOS.a(CCDevice-ios.o)
  "_OBJC_CLASS_$_EAGLContext", referenced from:
      objc-class-ref in libcocos2d iOS.a(CCDirectorCaller-ios.o)
  "_OBJC_CLASS_$_UIApplication", referenced from:
      objc-class-ref in libcocos2d iOS.a(CCApplication-ios.o)
      objc-class-ref in libcocos2d iOS.a(CCDirectorCaller-ios.o)
      objc-class-ref in libcocos2d iOS.a(CCDevice-ios.o)
  "_OBJC_CLASS_$_UIColor", referenced from:
      objc-class-ref in libcocos2d iOS.a(CCDevice-ios.o)
  "_OBJC_CLASS_$_UIDevice", referenced from:
      objc-class-ref in libcocos2d iOS.a(CCApplication-ios.o)
      objc-class-ref in libcocos2d iOS.a(CCDevice-ios.o)
  "_OBJC_CLASS_$_UIFont", referenced from:
      objc-class-ref in libcocos2d iOS.a(CCDevice-ios.o)
  "_OBJC_CLASS_$_UIImage", referenced from:
      objc-class-ref in libcocos2d iOS.a(CCImage-ios.o)
  "_OBJC_CLASS_$_UIScreen", referenced from:
      objc-class-ref in libcocos2d iOS.a(CCDevice-ios.o)
  "_UIApplicationDidBecomeActiveNotification", referenced from:
      -[CCDirectorCaller init] in libcocos2d iOS.a(CCDirectorCaller-ios.o)
  "_UIApplicationWillResignActiveNotification", referenced from:
      -[CCDirectorCaller init] in libcocos2d iOS.a(CCDirectorCaller-ios.o)
  "_UIGraphicsPopContext", referenced from:
      cocos2d::Device::getTextureDataForText(char const*, cocos2d::FontDefinition const&, cocos2d::Device::TextAlign, int&, int&, bool&) in libcocos2d iOS.a(CCDevice-ios.o)
  "_UIGraphicsPushContext", referenced from:
      cocos2d::Device::getTextureDataForText(char const*, cocos2d::FontDefinition const&, cocos2d::Device::TextAlign, int&, int&, bool&) in libcocos2d iOS.a(CCDevice-ios.o)
  "_UIImageJPEGRepresentation", referenced from:
      cocos2d::Image::saveToFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) in libcocos2d iOS.a(CCImage-ios.o)
  "_UIImagePNGRepresentation", referenced from:
      cocos2d::Image::saveToFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) in libcocos2d iOS.a(CCImage-ios.o)
  "AppDelegate::AppDelegate()", referenced from:
      _main in main.o
  "AppDelegate::~AppDelegate()", referenced from:
      _main in main.o
  "_glBindVertexArrayOES", referenced from:
      cocos2d::GL::bindVAO(unsigned int) in libcocos2d iOS.a(ccGLStateCache.o)
  "_glDeleteVertexArraysOES", referenced from:
      cocos2d::Renderer::~Renderer() in libcocos2d iOS.a(CCRenderer.o)
      cocos2d::MeshCommand::releaseVAO() in libcocos2d iOS.a(CCMeshCommand.o)
      cocos2d::TextureAtlas::~TextureAtlas() in libcocos2d iOS.a(CCTextureAtlas.o)
      cocos2d::CameraBackgroundSkyBoxBrush::~CameraBackgroundSkyBoxBrush() in libcocos2d iOS.a(CCCameraBackgroundBrush.o)
      cocos2d::CameraBackgroundSkyBoxBrush::initBuffer() in libcocos2d iOS.a(CCCameraBackgroundBrush.o)
      cocos2d::Physics3DDebugDrawer::~Physics3DDebugDrawer() in libcocos2d iOS.a(CCPhysics3DDebugDrawer.o)
      cocos2d::DrawNode::~DrawNode() in libcocos2d iOS.a(CCDrawNode.o)
  ...
  "_glGenVertexArraysOES", referenced from:
      cocos2d::Renderer::setupVBOAndVAO() in libcocos2d iOS.a(CCRenderer.o)
      cocos2d::MeshCommand::buildVAO() in libcocos2d iOS.a(CCMeshCommand.o)
      cocos2d::TextureAtlas::setupVBOandVAO() in libcocos2d iOS.a(CCTextureAtlas.o)
      cocos2d::CameraBackgroundSkyBoxBrush::initBuffer() in libcocos2d iOS.a(CCCameraBackgroundBrush.o)
      cocos2d::Physics3DDebugDrawer::init() in libcocos2d iOS.a(CCPhysics3DDebugDrawer.o)
      cocos2d::DrawNode::init() in libcocos2d iOS.a(CCDrawNode.o)
      cocos2d::VertexAttribBinding::init(cocos2d::MeshIndexData*, cocos2d::GLProgramState*) in libcocos2d iOS.a(CCVertexAttribBinding.o)
  ...
  "_glMapBufferOES", referenced from:
      cocos2d::Renderer::drawBatchedTriangles() in libcocos2d iOS.a(CCRenderer.o)
      cocos2d::TextureAtlas::drawNumberOfQuads(long, long) in libcocos2d iOS.a(CCTextureAtlas.o)
  "_glUnmapBufferOES", referenced from:
      cocos2d::Renderer::drawBatchedTriangles() in libcocos2d iOS.a(CCRenderer.o)
      cocos2d::TextureAtlas::drawNumberOfQuads(long, long) in libcocos2d iOS.a(CCTextureAtlas.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
EN

回答 1

Stack Overflow用户

发布于 2016-07-19 16:06:42

在您的项目设置中,转到“生成阶段”,然后在“将二进制文件与库链接”中添加OpenGLES.framework、UIKit.framework、ImageIO.framework、Foundation.framework和CoreGraphics.framework

清理项目并再次运行,希望它能开始运行。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38430143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档