繁体   English   中英

架构armv7的未定义符号:“ _ OBJC_CLASS _ $ _ SRWebSocket”

[英]Undefined symbols for architecture armv7: “_OBJC_CLASS_$_SRWebSocket”

我将SocketRocket用作WebSocket库,已通过cocoabot程序包管理器将其安装在MAC中,用于iOS 6平台。

在appDeligate.m中时,我放置了头文件

#import <SocketRocket/SRWebSocket.h>

在一个函数中,我正在使用:

SRWebSocket *_webSocket
_webSocket.delegate = nil;
[_webSocket close];

_webSocket = [[SRWebSocket alloc] initWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"ws://192.168.178.178:6001"]]];
_webSocket.delegate = self;

NSLog(@"Opening Connection...");
[_webSocket open];

在一个独立的项目中,这个工作很好,但是当我在项目中包含它时,会收到以下错误:

ld /用户/ devuser /库/开发人员/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Products/Debug-iphoneos/myProject.app/myProject正常armv7 cd / Users / devuser / Documents / cordovadev / myProject export IPHONEOS_PATH =“/应用/ Xcode.app /内容/开发/平台/ iPhoneOS.platform /开发人员的/ usr / bin中:/Applications/Xcode.app/Contents/Developer/usr/bin:在/ usr / local / bin目录:在/ usr / bin:/ bin:/ usr / sbin:/ sbin” /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -L / Users / devuser / Library / Developer / Xcode / DerivedData / myProject-fxqgbeafqfsypwclwioqqupwexue / Build / Products / Debug-iphoneos -F / Users / devuser / Library / Developer / Xcode / DerivedData / myProject-fxqgbeafqfsypwclwioqqupwexue / Build / Products / Debug-iphoneos -F / Applications / Xcode.app / Contents / Developer / Library / Frameworks -F / Users / devuser / Library / Deve loper / GStreamer / iPhone.sdk-文件列表/Users/devuser/Library/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Intermediates/myProject.build/Debug-iphoneos/myProject.build/Objects-normal/armv7/myProject。 LinkFileList -miphoneos-version-min = 6.0 -dead_strip -lresolv -lstdc ++ -framework CoreAudio -framework AudioToolbox -framework VideoToolbox -frameOpenGL OpenGLES -framework AssetsLibrary -framework QuartzCore -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework -lSystem -force_load /Users/devuser/Library/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Products/Debug-iphoneos/libCordova.a -ObjC -fobjc-link-runtime -framework GStreamer -lresolv -we CoreVideo -framework OpenGLES /用户/ devuser /库/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Products/Debug-iphoneos/libCordova.a -liconv -framework CoreMotion -framework CoreLocation -framework ImageIO -framework OpenAL -framework AssetsLibrary -framework Foundation -weak_framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework MediaPlayer -framework QuartzCore -frameService SystemConfiguration -framework lPods-myProject -Xlinker -dependency_info -Xlinker /Users/devuser/Library/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Intermediates/myProject.build/Debug-iphoneos/myProject.build/Objects-normal_depend/armv7/ dat -o /Users/devuser/Library/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Products/Debug-iphoneos/myProject.app/myProject

架构armv7的未定义符号:
“ _OBJC_CLASS _ $ _ SRWebSocket”,引用自:AppDelegate.o中的objc-class-ref

ld:找不到架构armv7的符号

clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

我已经检查了一下,但是找不到任何相关的东西。 有什么帮助吗?

我必须将套接字库链接到“构建设置”。

我添加的项目->构建设置->其他链接器标志->调试/发布

-ObjC -l SocketRocket -l icucore-框架CFNetwork-框架安全

现在可以了!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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