【问题标题】:gcc-4.2 failed with exit code 1 iphonegcc-4.2 失败,退出代码为 1 iphone
【发布时间】:2011-08-24 09:35:37
【问题描述】:

我尝试接收图像、解码并保存在 Documents 文件中,但在修改不同版本 Iphone 的 Uikit 限制后,我遇到了与 Core Services 库和 Uikit 的兼容性问题。我还有其他问题:

gcc-4.2 失败,退出代码为 1 iphone

在错误行中右击并选择“将这些最新结果作为转录文本文件打开”后:

Build WSStub of project WSStub with configuration Debug

Ld build/Debug/WSStub normal i386
cd /Users/********/Desktop/WSStub
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/********/Desktop/WSStub/build/Debug -F/Users/********/Desktop/WSStub/build/Debug -F/Users/********/Desktop/WSStub -filelist /Users/********/Desktop/WSStub/build/WSStub.build/Debug/WSStub.build/Objects-normal/i386/WSStub.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework CoreServices -framework UIKit -framework CoreGraphics -o /Users/********/Desktop/WSStub/build/Debug/WSStub

ld: warning: in /Users/********/Desktop/WSStub/UIKit.framework/UIKit, missing required architecture i386 in file
ld: warning: in /Users/********/Desktop/WSStub/CoreGraphics.framework/CoreGraphics, missing required architecture i386 in file
ld: duplicate symbol _UIEdgeInsetsMake in /Users/********/Desktop/WSStub/build/WSStub.build/Debug/WSStub.build/Objects-normal/i386/main.o and /Users/********/Desktop/WSStub/build/WSStub.build/Debug/WSStub.build/Objects-normal/i386/EnvioImagen.o
collect2: ld returned 1 exit status
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1

我无法解决这个问题.....

main.m

...

Envio * envio = [[Envio alloc] init];


[envio setMethod:method];
NSDictionary * imagen = [[NSDictionary alloc] initWithDictionary:[envio resultValue]];
NSString *im = [[NSString alloc] initWithString: [imagen valueForKey:@"return"]];
NSData * imagenDecode = [envio base64DataFromString:im];
[envio save:imagenDecode];

...

EnvioImagen.m

#import "EnvioImagen.h"

@implementation Envio


- (void) setMethod:(NSString*)myMethod
{...}

- (void) setInvocation:(NSString*)invoc
{...}

- (void) setSoap:(NSString*)mySoap
{...}

- (void) setNameSpace:(NSString*)myNamespace
{...}


- (NSDictionary*) resultValue
{...}

- (WSMethodInvocationRef) genCreateInvocationRef
{...}


+ (NSData *)base64DataFromString: (NSString *)string
{.....}

+ (void)save: (NSData *)data
 {

    UIImage *im = [[UIImage alloc]initWithData:data];
    NSData *datai = UIImagePNGRepresentation(im);

    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,     NSUserDomainMask, YES);
    NSString *directory = [paths objectAtIndex:0];
    NSString *fullPath = [directory stringByAppendingPathComponent:@"david.png"];
    [fileManager createFileAtPath:fullPath contents:datai attributes:nil];

}

@end; 

@implementation EnvioImagen

+ (id) Envio:(CFTypeRef) parameters
{
    id result = NULL; 

    Envio* invocation = [[Envio alloc] init];  

    result = [[invocation resultValue] retain];  

    [invocation release];    

    return result;    
}

@end

【问题讨论】:

    标签: iphone objective-c exit-code gcc4


    【解决方案1】:

    您已将 SDK 设置为 Mac OS X SDK 之一,而不是 iPhone SDK。 Mac OS X 没有 UIKit。

    【讨论】:

    • 好的,如何选择Iphone SDK?
    • @David:说实话,我不确定。 SDK 有一个构建设置。改变这一点可能就足够了。
    【解决方案2】:

    好像你在架构上搞砸了。所以编译器认为它是为 Mac OS 而不是 iOS 编译。检查您的构建设置和/或重新生成方案(产品->管理方案->自动生成)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-24
      • 1970-01-01
      • 1970-01-01
      • 2011-07-12
      相关资源
      最近更新 更多