Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译static library时的问题 #128

Open
e2ghost opened this issue May 6, 2015 · 5 comments
Open

编译static library时的问题 #128

e2ghost opened this issue May 6, 2015 · 5 comments

Comments

@e2ghost
Copy link

e2ghost commented May 6, 2015

我想将BeeFramework编译成静态库,在我的工程中直接引用(用dribble范例测试,删除原有的framework引用)。

编译成静态库(libBeeFramework.a)没有问题,但是在dribble中通过以下方式引用:
Other Link Flag: -ObjC -lBeeFramework
配置Header Search Path和Library Search Path

之后在工程中出现以下提示,不知是否我的静态库工程配置有误还是dribble工程配置有误,望解答

Undefined symbols for architecture i386:
"_CGSizeAuto", referenced from:
___62-[ServiceLogger_Board handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in ServiceLogger_Board.o
___70-[DribbbleProfileBoard_iPhone handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in DribbbleProfileBoard_iPhone.o
___69-[DribbbleDetailBoard_iPhone handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in DribbbleDetailBoard_iPhone.o
___62-[ServiceLogger_Board handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in ServiceLogger_Board.o
___70-[DribbbleProfileBoard_iPhone handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in DribbbleProfileBoard_iPhone.o
___69-[DribbbleDetailBoard_iPhone handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in DribbbleDetailBoard_iPhone.o
___62-[ServiceLogger_Board handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in ServiceLogger_Board.o
___70-[DribbbleProfileBoard_iPhone handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in DribbbleProfileBoard_iPhone.o
___69-[DribbbleDetailBoard_iPhone handleUISignal_BeeUIBoard_CREATE_VIEWS:]_block_invoke in DribbbleDetailBoard_iPhone.o
"OBJC_CLASS$_BeeOnceViewModel", referenced from:
OBJC_CLASS$_ShotInfoModel in ShotInfoModel.o
"OBJC_CLASS$_BeeUIActionSheet", referenced from:
objc-class-ref in DribbbleDetailBoard_iPhone.o
"OBJC_CLASS$_BeeUIActivityIndicatorView", referenced from:
objc-class-ref in DribbbleWebBoard_iPhone.o
"OBJC_CLASS$_BeeUIApplication", referenced from:
objc-class-ref in ServiceInspector_Window.o
OBJC_CLASS$_AppDelegate in AppDelegate.o
objc-class-ref in ServicePush.o
objc-class-ref in ServiceInspector_WindowHook.o
objc-class-ref in ServiceShare_Window.o
objc-class-ref in ServiceInspector.o
objc-class-ref in libBeeFramework.a(Bee_Service.o)
...
"OBJC_CLASS$_BeeUIBoard", referenced from:
OBJC_CLASS$_ServiceWizard_Board in ServiceWizard_Board.o
objc-class-ref in ServiceDebugger_DashBoard.o
OBJC_CLASS$ServiceDebugger_DashBoard in ServiceDebugger_DashBoard.o
l_OBJC
$CATEGORY_BeeUIBoard$_ServiceLiveloadPrivate in ServiceLiveload_Category.o
OBJC_CLASS$_ServiceLogger_Board in ServiceLogger_Board.o
OBJC_CLASS$_DribbbleWebBoard_iPhone in DribbbleWebBoard_iPhone.o
OBJC_CLASS$_DribbblePreviewBoard_iPhone in DribbblePreviewBoard_iPhone.o
...
"OBJC_CLASS$_BeeUIButton", referenced from:
objc-class-ref in ServiceInspector_Window.o
objc-class-ref in ServiceInspector_Dock.o
objc-class-ref in ServiceGridSystem_Dock.o
objc-class-ref in ServiceDebugger_Dock.o
objc-class-ref in ServiceLogger_Dock.o
"OBJC_CLASS$_BeeUICell", referenced from:
OBJC_CLASS$_ServiceDebugger_DashMessageCell in ServiceDebugger_DashMessageCell.o
OBJC_CLASS$_ServiceWizard_TemplateCell in ServiceWizard_TemplateCell.o
OBJC_CLASS$_DribbbleWebBoardTab_iPhone in DribbbleWebBoardTab_iPhone.o
OBJC_CLASS$_DribbbleDetailBoardPhoto_iPhone in DribbbleDetailBoardPhoto_iPhone.o
OBJC_CLASS$_ServiceLogger_Cell in ServiceLogger_Cell.o
OBJC_CLASS$_ServiceDebugger_DashMemoryCell in ServiceDebugger_DashMemoryCell.o
OBJC_CLASS$_DribbbleProfileBoardCell_iPhone in DribbbleProfileBoardCell_iPhone.o
...
"OBJC_CLASS$_BeeUIConfig", referenced from:
objc-class-ref in ServiceDebugger_DashBoard.o
objc-class-ref in ServiceShare_TencentWeibo_AuthorizeBoard.o
objc-class-ref in ServiceShare_SinaWeibo_AuthorizeBoard.o
objc-class-ref in ServiceShare_AuthorizeBoard.o
"OBJC_CLASS$_BeeUIFootLoader", referenced from:
OBJC_CLASS$_FootLoader in FootLoader.o
"OBJC_CLASS$_BeeUIImageView", referenced from:
OBJC_CLASS$_ServiceInspector_Layer in ServiceInspector_Window.o
OBJC_CLASS$_ServiceInspector_Indicator in ServiceInspector_Indicator.o
OBJC_CLASS$_ServiceInspector_Border in ServiceInspector_Border.o
OBJC_CLASS$_ServiceLiveload_Border in ServiceLiveload_Border.o
"OBJC_CLASS$_BeeUILabel", referenced from:
objc-class-ref in ServiceInspector_Window.o
OBJC_CLASS$_ServiceWireframeView in ServiceWireframeView.o
"OBJC_CLASS$_BeeUINavigationBar", referenced from:
objc-class-ref in AppDelegate.o
"OBJC_CLASS$_BeeUIPullLoader", referenced from:
OBJC_CLASS$_PullLoader in PullLoader.o
"OBJC_CLASS$_BeeUIRouter", referenced from:
objc-class-ref in DribbbleBoard_iPhone.o
"OBJC_CLASS$BeeUIScrollView", referenced from:
objc-class-ref in ServiceDebugger_DashBoard.o
l_OBJC
$CATEGORY_BeeUIScrollView$_ServiceLiveloadPrivate in ServiceLiveload_Category.o
"OBJC_CLASS$_BeeUIStack", referenced from:
objc-class-ref in AppDelegate.o
"OBJC_CLASS$_BeeUIStyleManager", referenced from:
objc-class-ref in ServiceLiveload_Category.o
"OBJC_CLASS$_BeeUITemplateManager", referenced from:
objc-class-ref in ServiceLiveload_Hook.o
"OBJC_CLASS$_BeeUITemplateParser", referenced from:
objc-class-ref in ServiceWizard_Board.o
"OBJC_CLASS$_BeeUITemplateParserXML", referenced from:
objc-class-ref in ServiceDebugger.o
"OBJC_CLASS$_BeeUIWebView", referenced from:
objc-class-ref in DribbbleWebBoard_iPhone.o
"OBJC_CLASS$_BeeUIWindow", referenced from:
OBJC_CLASS$_ServiceInspector_Window in ServiceInspector_Window.o
OBJC_CLASS$_ServiceDebugger_StatusBar in ServiceDebugger_StatusBar.o
OBJC_CLASS$_ServiceInspector_Dock in ServiceInspector_Dock.o
OBJC_CLASS$_ServiceGridSystem_Dock in ServiceGridSystem_Dock.o
OBJC_CLASS$_ServiceGridSystem_Window in ServiceGridSystem_Window.o
OBJC_CLASS$_ServiceDebugger_Window in ServiceDebugger_Window.o
OBJC_CLASS$_ServiceWizard_Window in ServiceWizard_Window.o
...
"OBJC_CLASS$_BeeViewModel", referenced from:
OBJC_CLASS$_BeePagingViewModel in libBeeFramework.a(Bee_PagingViewModel.o)
OBJC_CLASS$_BeeStreamViewModel in libBeeFramework.a(Bee_StreamViewModel.o)
"OBJC_METACLASS$_BeeOnceViewModel", referenced from:
OBJC_METACLASS$_ShotInfoModel in ShotInfoModel.o
"OBJC_METACLASS$_BeeUIApplication", referenced from:
OBJC_METACLASS$_AppDelegate in AppDelegate.o
"OBJC_METACLASS$_BeeUIBoard", referenced from:
OBJC_METACLASS$_ServiceWizard_Board in ServiceWizard_Board.o
OBJC_METACLASS$_ServiceDebugger_DashBoard in ServiceDebugger_DashBoard.o
OBJC_METACLASS$_ServiceLogger_Board in ServiceLogger_Board.o
OBJC_METACLASS$_DribbbleWebBoard_iPhone in DribbbleWebBoard_iPhone.o
OBJC_METACLASS$_DribbblePreviewBoard_iPhone in DribbblePreviewBoard_iPhone.o
OBJC_METACLASS$_ServiceShare_AuthorizeBoard in ServiceShare_AuthorizeBoard.o
OBJC_METACLASS$_DribbbleBoard_iPhone in DribbbleBoard_iPhone.o
...
"OBJC_METACLASS$_BeeUICell", referenced from:
OBJC_METACLASS$_ServiceDebugger_DashMessageCell in ServiceDebugger_DashMessageCell.o
OBJC_METACLASS$_ServiceWizard_TemplateCell in ServiceWizard_TemplateCell.o
OBJC_METACLASS$_DribbbleWebBoardTab_iPhone in DribbbleWebBoardTab_iPhone.o
OBJC_METACLASS$_DribbbleDetailBoardPhoto_iPhone in DribbbleDetailBoardPhoto_iPhone.o
OBJC_METACLASS$_ServiceLogger_Cell in ServiceLogger_Cell.o
OBJC_METACLASS$_ServiceDebugger_DashMemoryCell in ServiceDebugger_DashMemoryCell.o
OBJC_METACLASS$_DribbbleProfileBoardCell_iPhone in DribbbleProfileBoardCell_iPhone.o
...
"OBJC_METACLASS$_BeeUIFootLoader", referenced from:
OBJC_METACLASS$_FootLoader in FootLoader.o
"OBJC_METACLASS$_BeeUIImageView", referenced from:
OBJC_METACLASS$_ServiceInspector_Layer in ServiceInspector_Window.o
OBJC_METACLASS$_ServiceInspector_Indicator in ServiceInspector_Indicator.o
OBJC_METACLASS$_ServiceInspector_Border in ServiceInspector_Border.o
OBJC_METACLASS$_ServiceLiveload_Border in ServiceLiveload_Border.o
"OBJC_METACLASS$_BeeUILabel", referenced from:
OBJC_METACLASS$_ServiceWireframeView in ServiceWireframeView.o
"OBJC_METACLASS$_BeeUIPullLoader", referenced from:
OBJC_METACLASS$_PullLoader in PullLoader.o
"OBJC_METACLASS$_BeeUIWindow", referenced from:
OBJC_METACLASS$_ServiceInspector_Window in ServiceInspector_Window.o
OBJC_METACLASS$_ServiceDebugger_StatusBar in ServiceDebugger_StatusBar.o
OBJC_METACLASS$_ServiceInspector_Dock in ServiceInspector_Dock.o
OBJC_METACLASS$_ServiceGridSystem_Dock in ServiceGridSystem_Dock.o
OBJC_METACLASS$_ServiceGridSystem_Window in ServiceGridSystem_Window.o
OBJC_METACLASS$_ServiceDebugger_Window in ServiceDebugger_Window.o
OBJC_METACLASS$_ServiceWizard_Window in ServiceWizard_Window.o
...
"OBJC_METACLASS$_BeeViewModel", referenced from:
OBJC_METACLASS$_BeePagingViewModel in libBeeFramework.a(Bee_PagingViewModel.o)
OBJC_METACLASS$_BeeStreamViewModel in libBeeFramework.a(Bee_StreamViewModel.o)
"___getQueryBlock", referenced from:
-[ServiceDebugger_DashMessageCell load] in ServiceDebugger_DashMessageCell.o
-[ServiceDebugger_DashMessageCell dataDidChanged] in ServiceDebugger_DashMessageCell.o
-[DribbbleDetailBoardPhoto_iPhone dataDidChanged] in DribbbleDetailBoardPhoto_iPhone.o
-[ServiceDebugger_DashMemoryCell load] in ServiceDebugger_DashMemoryCell.o
-[ServiceDebugger_DashMemoryCell dataDidChanged] in ServiceDebugger_DashMemoryCell.o
-[ServiceDebugger_DashCPUCell load] in ServiceDebugger_DashCPUCell.o
-[ServiceDebugger_DashCPUCell dataDidChanged] in ServiceDebugger_DashCPUCell.o
...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@michaelxxw
Copy link

是不是需要打个通用二进制包?看看这个是否有帮助:http://www.cocoachina.com/industry/20131204/7468.html

@e2ghost
Copy link
Author

e2ghost commented May 19, 2015

制作静态库没问题,我已经制作好了,只是在范例工程里把framework的引用删除后,引入我制作的静态库进行编译才出的问题。

@michaelxxw
Copy link

我能想到的两个方面1.是否在Build Setting→Search Paths→Header Search Paths 里添加了静态库的路径 2.尝试关闭xcode,然后清除~/Library/Developer/Xcode/DerivedData/ 目录下项目相关的所有缓存,再重新编译。希望能帮到你~~

@michaelxxw
Copy link

另外,有没有用lipo -info 看一下你的静态库 是否支持i386?

@e2ghost
Copy link
Author

e2ghost commented May 19, 2015

谢谢解答,不过我有配置了Other Link Flag: -ObjC -lBeeFramework以及配置Header Search Path和Library Search Path,如果没有配置提示的会是其他类型的错误

我再检查一下有没有配置的问题吧,之前怀疑是architecture的问题,但好像又不是。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants