2015-04-28 62 views
0

我是IOS開發人員的初學者。我嘗試構建一個包含Swift和Objective C語言的應用程序。在我使用的應用程序庫命名爲libjjeromq.a女巫我已經使用這個命令編譯:使用靜態庫的Xcode上架構x86_64的未定義符號

ar -rv libjjermoq.a [liste of files.o] 
  • 我有庫添加到鏈接庫。我也添加了庫搜索路徑。

  • 我已經加入-ObjC

  • 我已經添加的所有文件.M編譯文件源

  • 我已經配置的報頭搜索路徑

  • 我測試的標誌libjjeromq.a庫,它能夠在x86_64體系結構上工作。

但是,當我建我得到的錯誤是這樣的:

Undefined symbols for architecture x86_64: 
    "_IOSArray_throwOutOfBoundsWithMsg", referenced from: 
     _OrgZeromqZMQ_pollWithOrgZeromqZMQ_PollItemArray_withInt_withLong_ in ZMQ.o 
     -[OrgZeromqZMQ_Poller unregisterWithOrgZeromqZMQ_Socket:] in ZMQ.o 
     _OrgZeromqZMQ_Poller_removeWithInt_ in ZMQ.o 
     -[OrgZeromqZMQ_Poller unregisterWithJavaNioChannelsSelectableChannel:] in ZMQ.o 
     -[OrgZeromqZMQ_Poller getItemWithInt:] in ZMQ.o 
     -[OrgZeromqZMQ_Poller getSocketWithInt:] in ZMQ.o 
     -[OrgZeromqZMQ_Poller pollWithLong:] in ZMQ.o 
     ... 
    "_IOSClass_class_", referenced from: 
     _ZmqStreamEngine_new_decoderWithInt_withLong_withZmqSessionBase_withInt_ in StreamEngine.o 
     _ZmqStreamEngine_new_encoderWithInt_withZmqSessionBase_withInt_ in StreamEngine.o 
     _ZmqStreamEngine_new_decoderWithInt_withLong_withZmqSessionBase_withInt_ in libjjermoq.a(StreamEngine.o) 
     _ZmqStreamEngine_new_encoderWithInt_withZmqSessionBase_withInt_ in libjjermoq.a(StreamEngine.o) 
    "_IOSClass_forNameWithNSString_", referenced from: 
     -[ZmqOptions setsockoptWithInt:withId:] in Options.o 
     -[ZmqOptions setsockoptWithInt:withId:] in libjjermoq.a(Options.o) 
    "_IOSClass_fromClass", referenced from: 
     ___OrgZeromqZMQ_class__block_invoke in ZMQ.o 
     ___OrgZeromqZMQ_Context_class__block_invoke in ZMQ.o 
     ___OrgZeromqZMQ_Socket_class__block_invoke in ZMQ.o 
     ___OrgZeromqZMQ_Poller_class__block_invoke in ZMQ.o 
     ___OrgZeromqZMQ_PollItem_class__block_invoke in ZMQ.o 
     ___OrgZeromqZMQ_ErrorEnum_class__block_invoke in ZMQ.o 
     ___OrgZeromqZMQ_Event_class__block_invoke in ZMQ.o 
     ... 
    "_IOSClass_fromProtocol", referenced from: 
     ___OrgZeromqZLoop_IZLoopHandler_class__block_invoke in ZLoop.o 
     ___OrgZeromqZThread_IAttachedRunnable_class__block_invoke in ZThread.o 
     ___OrgZeromqZThread_IDetachedRunnable_class__block_invoke in ZThread.o 
     ___ZmqAddress_IZAddress_class__block_invoke in Address.o 
     ___ZmqIDecoder_class__block_invoke in IDecoder.o 
     ___ZmqIEncoder_class__block_invoke in IEncoder.o 
     ___ZmqIEngine_class__block_invoke in IEngine.o 
     ... 
    "_IOSObjectArray_Set", referenced from: 
     _OrgZeromqZMQ_pollWithOrgZeromqZMQ_PollItemArray_withInt_withLong_ in ZMQ.o 
     _OrgZeromqZMQ_Poller_insertWithOrgZeromqZMQ_PollItem_ in ZMQ.o 
     _OrgZeromqZMQ_Poller_removeWithInt_ in ZMQ.o 
     -[OrgZeromqZMQ_Poller pollWithLong:] in ZMQ.o 
     _OrgZeromqZLoop_rebuild in ZLoop.o 
     -[ZmqCtx create_socketWithInt:] in Ctx.o 
     -[ZmqCtx destroy_socketWithZmqSocketBase:] in Ctx.o 
     ... 
    "_IOSObjectArray_SetAndConsume", referenced from: 
     _ZmqMtrie_add_helperWithByteArray_withInt_withZmqPipe_ in Mtrie.o 
     _ZmqPipe_pipepairWithZmqZObjectArray_withZmqPipeArray_withIntArray_withBooleanArray_ in Pipe.o 
     _ZmqProxy_proxyWithZmqSocketBase_withZmqSocketBase_withZmqSocketBase_ in Proxy.o 
     -[ZmqTrie addWithByteArray:withInt:] in Trie.o 
     _ZmqMtrie_add_helperWithByteArray_withInt_withZmqPipe_ in libjjermoq.a(Mtrie.o) 
     _ZmqPipe_pipepairWithZmqZObjectArray_withZmqPipeArray_withIntArray_withBooleanArray_ in libjjermoq.a(Pipe.o) 
     _ZmqProxy_proxyWithZmqSocketBase_withZmqSocketBase_withZmqSocketBase_ in libjjermoq.a(Proxy.o) 
     ... 

請某人能幫助我嗎?

回答

0

問題是有兩個不同的文件位於兩個不同的曲目中,但它們具有相同的名稱!這些文件是:org/zeromq/zmq.o和zmq/zmq.o。

創建庫的過程:ar -rv libjjermoq.a [liste of files.o]隨機選擇它找到的第一個zmq.o,並忽略另一個!因此,在錯過的zmq.o中定義的methodes witch將不會在結果庫.a中找到。

溶劑是重命名其中一個文件,並避免在所有情況下有兩個或更多的文件具有相同的名稱,即使他們在不同的劇目!

相關問題