架构的未定义符号 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];

在独立项目中,这工作得很好,但是当我将其包含在我的项目中时,我收到以下错误:

低密度 /users/devuser/library/developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Products/Debug-iphoneos/myProject.app/myProject 普通手臂V7 cd/Users/devuser/Documents/cordovadev/myProject 导出IPHONEOS_DEPLOYMENT_TARGET=6.0 export PATH="/Applications/Xcode.app/Content/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Content/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Content/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot/Applications/Xcode.app/Content/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/Content/Developer/Library/Frameworks -F/Users/devuser/Library/Developer/GStreamer/iPhone.sdk -filelist/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 -framework OpenGLES -framework AssetsLibrary -framework QuartzCore -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak_framework CoreMotion -weak-lSystem -force_load/Users/devuser/Library/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Products/Debug-iphoneos/libCordova.a -ObjC -fobjc-link-runtime -framework GStreamer -lresolv -weak_framework CoreMedia -framework CoreVideo -framework OpenGLES/Users/devuser/Library/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Products/Debug-iphoneos/libCordova.a -liconv -framework CoreMotion -framework CoreLocation -framework ImageIO -framework OpenAL -framework AssetsLibrary -framework 基础 -weak_framework UIKit -框架 核心图形 -框架 地址簿 -框架 地址簿UI -框架 音频工具箱 -weak_framework AVFoundation -framework CFNetwork -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -lPods-myProject -Xlinker -dependency_info -Xlinker/Users/devuser/Library/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Intermediates/myProject.build/Debug-iphoneos/myProject.build/Objects-normal/armv7/myProject_dependency_info.dat -o/Users/devuser/Library/Developer/Xcode/DerivedData/myProject-fxqgbeafqfsypwclwioqqupwexue/Build/Products/Debug-iphoneos/myProject.app/myProject

架构 armv7 的未定义符号:
"_OBJC_CLASS_$_SRWebSocket",引用自: objc-class-ref in AppDelegate.o

LD:找不到架构 ARMv7 的符号

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

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

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

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

-ObjC-l 插座火箭-l ICU核心-框架 CFNetwork-框架安全

现在它正在工作!

最新更新