基本上,我跟着这里的说明:http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_LinuxGNUstep的弧形和桂失败不兼容的ABI
为建设GUI和背面的额外步骤。
如果我构建并运行非gui程序,一切运行良好。只有当我补充一点,就是使用图形用户界面,如下所示:
// Created by Tobias Lensing on 2/22/13.
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import <dispatch/dispatch.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
int multiplier = 7;
int (^myBlock)(int) = ^(int num) {
return num * multiplier;
};
NSLog(@"%d", myBlock(3));
dispatch_queue_t queue = dispatch_queue_create(NULL, NULL);
dispatch_sync(queue, ^{
printf("Hello, world from a dispatch queue!\n");
});
// dispatch_release(queue); // ARC takes care of this
}
@autoreleasepool {
[NSApplication sharedApplication];
NSRunAlertPanel(@"Test", @"Wow it works!", @"OK", nil, nil);
}
return 0;
}
我用下面的编译此:
clang `gnustep-config --objc-flags` `gnustep-config --objc-libs` -fobjc-arc -fobjc-runtime=gnustep -fblocks -lobjc -ldispatch -lgnustep-gui test.m
它编译并没有错误链接。
当我运行它,但是,它吐出以下丑克:
Hello, world from a dispatch queue!
Objective-C ABI Error: Loading modules from incompatible ABI's while loading .GSBackend.m
a.out: /home/lloyd/projects/ThirdParty/BuildGnuStep/libobjc2/loader.c:53: void __objc_exec_class(struct objc_module_abi_8 *): Assertion `objc_check_abi_verion(module)' failed.
Aborted (core dumped)
我已经安慰过自己,没有其他版本libobjc的(这是一个虚拟机上,所以我可以去回来重做我的步骤)。
谈到了以下工作:
// [NSApplication sharedApplication];
// NSRunAlertPanel(@"Test", @"Wow it works!", @"OK", nil, nil);
,一切从GUI编译和运行,除了明显。
当我从头开始构建所有东西时,我如何拥有两个ABI?我需要以不同的方式配置GUI吗?我一直在困惑这个几个星期。
根据该博客文章今天发布... –
这是一个明显的笑话不要毁了它。 –
好吧,不知道这个笑话是什么,但它解决了我的问题。 –