我对Xcode和Iphone开发很新,遇到了以下问题:
我打开了一个新项目并添加了*.h和一个*.a文件(我从某个设备供应商那里获得).我收到以下警告:
ld:警告:忽略文件/ Users/udi/Desktop/Xcode/Xcode Projects/Scosche/libmyTrekSDK_armv7.a,缺少文件/ Users/udi/Desktop/Xcode/Xcode Projects/Scosche/libmyTrekSDK_armv7.a中所需的架构i386(2个切片) )
如果我忽略该警告,并尝试实例化在头文件中提供给我的类,我会收到以下错误:
ld:警告:忽略文件[Path/FileName.a],缺少文件中所需的体系结构i386 [Path/FileName.a](2个切片)
架构i386的未定义符号:
"_OBJC_CLASS _ $ _ HRMonitor",引自:
ViewController.o中的objc-class-ref
ld:找不到架构i386的符号
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
我已经检查了Framework Search Pathes(正如许多其他帖子中提到的那样)并且清楚了.
更多信息:
感谢任何帮助
添加MapKit和CoreLocation框架后,我无法构建我的应用程序.它们都是4.3框架,用于与UIKit,CoreGraphics和Foundation一起工作的应用程序,只是给我这两个问题.不确定所需的架构是什么,代码中没有任何错误.任何帮助表示赞赏!
ld: warning: ignoring file /Users/F3d3r3r/Desktop/testNav4_3/MapKit.framework/MapKit, missing required architecture i386 in file
ld: warning: ignoring file /Users/F3d3r3r/Desktop/testNav4_3/CoreLocation.framework/CoreLocation, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_CLLocationCoordinate2DMake", referenced from:
-[Layer2 tableView:cellForRowAtIndexPath:] in Layer2.o
"_OBJC_CLASS_$_MKMapView", referenced from:
objc-class-ref in Layer2.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud) 有时人们想要真的讨厌Apple开发环境.说真的,这需要复杂吗?
我的问题是这个.我不再能够将我的项目构建到模拟器.我收到以下错误.我意识到这是一个链接器错误 - 我不明白的是1)为什么这突然不再起作用,2)为什么它不会选择正确的SDK(这是链接器错误的原因).
Apple Magik令人沮丧.
此外,我刚刚升级到Snow Leopard和XCode 3.2,虽然升级后它正在运行.
谢谢!布赖恩
Ld build/Debug-iphonesimulator/ChunderCats.app/ChunderCats normal i386
cd /Users/bryan/projects/iPhone/ChunderCats
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk -L/Users/bryan/projects/iPhone/ChunderCats/build/Debug-iphonesimulator -L/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib -F/Users/bryan/projects/iPhone/ChunderCats/build/Debug-iphonesimulator -F/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks -filelist /Users/bryan/projects/iPhone/ChunderCats/build/ChunderCats.build/Debug-iphonesimulator/ChunderCats.build/Objects-normal/i386/ChunderCats.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework QuartzCore -framework UIKit -framework CoreGraphics -lsqlite3 -o /Users/bryan/projects/iPhone/ChunderCats/build/Debug-iphonesimulator/ChunderCats.app/ChunderCats
ld: warning: in /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/Foundation.framework/Foundation, missing required architecture i386 in file
ld: warning: in /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore, missing required architecture i386 in file
ld: warning: in /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit, missing required architecture i386 in file
ld: warning: in /Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics, missing …Run Code Online (Sandbox Code Playgroud) 我现在遇到一个问题我正在尝试用Xcode 4.0构建一个项目,希望有人可以为我阐明这个问题.
我正在尝试使用ZBar SDK,并遵循此处概述的指南中列出的说明:
http://zbar.sourceforge.net/iphone/sdkdoc/camera.html
但是,我得到了同样的错误.我检查了John的帖子,但是,他提到的路径不在我的LIBRARY_SEARCH_PATH中.
我正在使用Xcode 4.0,我正在尝试为iPad 4.3模拟器构建我的项目.
(我得到的错误):
Undefined symbols for architecture i386:
"_objc_msgSend", referenced from:
_main in main.o
-[PrototypeAppDelegate application:didFinishLaunchingWithOptions:] in PrototypeAppDelegate.o
-[PrototypeAppDelegate dealloc] in PrototypeAppDelegate.o
-[Home loadGRView] in Home.o
...
"_UIApplicationMain", referenced from:
_main in main.o
"_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
objc-class-ref in main.o
"_objc_msgSendSuper2", referenced from:
-[PrototypeAppDelegate dealloc] in PrototypeAppDelegate.o
-[PrototypeAppDelegate_iPhone dealloc] in PrototypeAppDelegate_iPhone.o
...
"_objc_setProperty", referenced from:
-[PrototypeAppDelegate setTabBarController:] in PrototypeAppDelegate.o
-[PrototypeAppDelegate setTheNavController:] in PrototypeAppDelegate.o
...
Run Code Online (Sandbox Code Playgroud)
等等
我试过看看ZBar sdk附带的ReaderSample代码,并认为问题是我错过了他们在他们的应用程序中使用的几个框架,但包括那些框架只是增加了我得到的错误数量.这是Build设置问题吗?有没有人有我可以尝试做的想法?
PS:我找到了两个类似于这个问题的线程,并尝试了他们推荐的各种解决方案,仍然无法得到解决方案
-http://stackoverflow.com/questions/1452466/suddenly-i-am-not-able-to-build-for-the-iphone-simulator -http://stackoverflow.com/questions/1456185/build-error需要-missing-架构-I386-在文件/ 1467238#1467238
我希望我正确使用这个线程...我对堆栈溢出相对较新.Ť
我收到许多类型的警告:
'__strong'仅适用于objective-c对象或块指针类型; 这里输入的是......
警告指向框架标题.例如NSNotification,NSURL,NSIndexset等.
它们是什么,我该如何修复它?
注1:我使用ARC
注意2:该应用程序似乎工作
编辑1:警告似乎来自我的pch文件.这是:
//
// Prefix header for all source files of the 'myapp' target in the 'myapp' project
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
Run Code Online (Sandbox Code Playgroud)
编辑2:警告示例:NSString.h中的警告指向:
/* Methods to convert NSString to a NULL-terminated cString using the specified encoding. Note, these are the "new" cString methods, and are not deprecated like the older cString methods …Run Code Online (Sandbox Code Playgroud) 我为iPad开发了一个应用程序.
现在,我在iPad-5.1模拟器上测试应用程序.
而对于我的不快乐,应用程序就会失败.
1)我使用FacebookSDK 3.0
2)编译FacebookSDK到框架FBiOSSDK
3)添加框架FBiOSSDK项目
4)查看日志链接
5)i386硬件架构未定义的符号:"_sqlite3_open_v2"和多对多"_sqlite3_*"符号.
也许我在将它构建到框架时为facebook-sdk项目设置了错误的选项?
有人可以帮忙吗?
搜索后,我找到了一个解决方案:
"添加到项目libsqlite3.0.dylib"
但是Linker说:"忽略文件/path/libsqlite3.dylib,在文件中缺少必需的架构i386"
- 主要问题 -
一小时后,我发现,我以错误的方式链接框架.
脚本在本地目录中创建它(不在System/Library/Frameworks或Library/Frameworks中).
添加后,Framework Search Paths更改为非默认值.
如何以正确的方式构建框架?
谢谢!
我得到这个链接器错误,不会让我编译.它只发生在模拟器上.
要点:
-只发生在模拟器
-以类似这个问题,却发现我的.pbxproj文件中没有FRAMEWORK_SEARCH_PATHS
-虽然我的操作系统是10.6.2,我必须建立目标1.5,以避免其他链接错误
- libxml2.dylib IS必需的,在我的框架组
- 我从未听说过的其他引用的库.
- 尝试在框架下引入其他Libs,没有解决.
Build SpaceTweet of project SpaceTweet with configuration Debug
Ld build/Debug-iphonesimulator/SpaceTweet.app/SpaceTweet normal i386
cd "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)"
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk "-L/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator" -L/Users/Scott/Desktop "-L/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/../../libYAJLIPhone-0" -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib -L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk/usr/lib -L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib "-F/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator" -filelist "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/SpaceTweet.build/Debug-iphonesimulator/SpaceTweet.build/Objects-normal/i386/SpaceTweet.LinkFileList" -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -framework AVFoundation -framework MessageUI -lYAJLIPhone -lxml2 -o "/Users/Scott/Desktop/iPhone Dev/SpaceTweet(Experimental)/build/Debug-iphonesimulator/SpaceTweet.app/SpaceTweet"
ld: warning: in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/libxml2.dylib, missing required architecture i386 in file …Run Code Online (Sandbox Code Playgroud) compiler-construction iphone xcode osx-snow-leopard ios-simulator
iphone ×5
xcode ×3
i386 ×2
architecture ×1
build ×1
cocoa-touch ×1
facebook ×1
linker ×1
mapkit ×1
objective-c ×1
symbols ×1
undefined ×1
xcode4.5 ×1