2016-07-18 30 views
0

Ich bin neu in Cocos2d und Xcode (sowie Spielentwicklung und Mac, ich war Fenster und Eclipse-Benutzer). Ich arbeite an programmer guide von Coco2dx Homepage. Ich habe den Git klonen und versuchen, den Code auszuführen, aber ich habe einen Kompilierungsfehler mit libcocos2d iOS.a. Ich habe den Bibliothekspfad (zu libcocos2d) und die Headerdatei eingerichtet, die den Fehler "cocos2d.h not found" verursacht hat. Aber jetzt habe ich ein Problem mit Linker-Fehlern. Ich habe gegoogelt, um Build-Architektur Fehler, aber keine Waren zu finden. Meine aktuelle Build-Einstellung für Build-Architektur ist, dass Ja zu debuggen, Nein zu Release, Architektur ist auf 64bit x86_64 Standard gesetzt, und gültige Architekturen sind -armv7, armv7s, i386, x86_64 und arm64- Können mir einige dabei helfen?cocos2dx Build scheitern wegen undefined Symbol

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) 

Antwort

1

In den Projekteinstellungen gehen, zu 'bauen Phasen' und in 'Link-Binary mit Bibliotheken' in OpenGLES.framework, UIKit.framework, ImageIO.framework, Foundation.framework und CoreGraphics.framework

bereinigen Sie das Projekt und starten Sie es erneut, hoffentlich startet es.