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

发布于 2024-12-01 01:20:13 字数 3076 浏览 0 评论 0原文

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

gcc-4.2 failed with exit code 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

I´ve tryed to receive a image, decode and save in Documents file but i had some problem of compatibility with Core Services library and Uikit, after modify Uikit restrictions of different version of Iphone. I have other problem:

gcc-4.2 failed with exit code 1 iphone

After right click in the error line and choose "Open These Latest Results as Transcript Text File":

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

I can´t solve this problem.....

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萝莉病 2024-12-08 01:20:13

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

You've set your SDK to one of the Mac OS X SDKs, not an iPhone SDK. Mac OS X doesn't have the UIKit.

一抹淡然 2024-12-08 01:20:13

看起来你把架构弄乱了。因此编译器认为它是针对 Mac OS 而不是 iOS 进行编译的。检查您的构建设置和/或重新生成方案(产品->管理方案->自动生成)。

Seems like you messed something up with architectures. So compilers thinks it is compiling for Mac OS instead of iOS. Check your build settings and/or regenerate schemes(Product->Manage Schemes->Autogenerate).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文