简体   繁体   中英

How to get rid of Apple Mach-O Linker Errors?

First I had a Could not build module Foundation

Tried to solve that by setting Enable Modules (C and Objective-C) to NO

After another build I get these strange errors:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_EAGLContext", referenced from:
      objc-class-ref in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_OBJC_CLASS_$_GLKBaseEffect", referenced from:
      objc-class-ref in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_OBJC_CLASS_$_GLKViewController", referenced from:
      _OBJC_CLASS_$_EZAudioPlotGLKViewController in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_OBJC_CLASS_$_NSEntityDescription", referenced from:
      objc-class-ref in JSONModel+CoreData.o
  "_OBJC_CLASS_$_NSManagedObject", referenced from:
      l_OBJC_$_CATEGORY_NSManagedObject_$_JSONModel in JSONModel+CoreData.o
      objc-class-ref in JSONModel+CoreData.o
  "_OBJC_METACLASS_$_GLKViewController", referenced from:
      _OBJC_METACLASS_$_EZAudioPlotGLKViewController in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_SSLClose", referenced from:
      -[GCDAsyncSocket closeWithError:] in GCDAsyncSocket.o
  "_SSLCopyPeerTrust", referenced from:
      -[GCDAsyncSocket ssl_continueSSLHandshake] in GCDAsyncSocket.o
  "_SSLCreateContext", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLGetBufferedReadSize", referenced from:
      ___33-[GCDAsyncSocket flushSSLBuffers]_block_invoke in GCDAsyncSocket.o
      -[GCDAsyncSocket doReadData] in GCDAsyncSocket.o
  "_SSLHandshake", referenced from:
      -[GCDAsyncSocket ssl_continueSSLHandshake] in GCDAsyncSocket.o
  "_SSLRead", referenced from:
      -[GCDAsyncSocket flushSSLBuffers] in GCDAsyncSocket.o
      -[GCDAsyncSocket doReadData] in GCDAsyncSocket.o
  "_SSLSetCertificate", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetConnection", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetEnabledCiphers", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetIOFuncs", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetPeerDomainName", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetPeerID", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetProtocolVersionMax", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetProtocolVersionMin", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLSetSessionOption", referenced from:
      -[GCDAsyncSocket ssl_startTLS] in GCDAsyncSocket.o
  "_SSLWrite", referenced from:
      -[GCDAsyncSocket doWriteData] in GCDAsyncSocket.o
  "_glBindBuffer", referenced from:
      -[EZAudioPlotGLKViewController _updateBufferPlotBufferWithAudioReceived:withBufferSize:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _updateRollingPlotBufferWithAudioReceived:withBufferSize:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _drawBufferPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _drawRollingPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glBufferData", referenced from:
      -[EZAudioPlotGLKViewController _updateBufferPlotBufferWithAudioReceived:withBufferSize:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _updateRollingPlotBufferWithAudioReceived:withBufferSize:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glBufferSubData", referenced from:
      -[EZAudioPlotGLKViewController _clearRollingPlot] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _updateBufferPlotBufferWithAudioReceived:withBufferSize:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _updateRollingPlotBufferWithAudioReceived:withBufferSize:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _updateRollingPlotDisplay] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glClear", referenced from:
      -[EZAudioPlotGLKViewController glkView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glClearColor", referenced from:
      -[EZAudioPlotGLKViewController _refreshWithBackgroundColor:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glDrawArrays", referenced from:
      -[EZAudioPlotGLKViewController _drawBufferPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _drawRollingPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glEnableVertexAttribArray", referenced from:
      -[EZAudioPlotGLKViewController _drawBufferPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _drawRollingPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glGenBuffers", referenced from:
      -[EZAudioPlotGLKViewController viewDidLoad] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glLineWidth", referenced from:
      -[EZAudioPlotGLKViewController viewDidLoad] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glPopMatrix", referenced from:
      -[EZAudioPlotGLKViewController _drawBufferPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _drawRollingPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glPushMatrix", referenced from:
      -[EZAudioPlotGLKViewController _drawBufferPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _drawRollingPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
  "_glVertexAttribPointer", referenced from:
      -[EZAudioPlotGLKViewController _drawBufferPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
      -[EZAudioPlotGLKViewController _drawRollingPlotWithView:drawInRect:] in EZAudioPlotGLKViewController-11ED1EEF7D7801BD.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am clueless. This happened after I updated this project from our SVN repository.

You need to link in the following frameworks:

CoreData.framework
GLKit.framework
Security.framework

Which is accomplished in the following bit of Xcode:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM