[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: incompatible ABI when using the GUI
From: |
David Chisnall |
Subject: |
Re: incompatible ABI when using the GUI |
Date: |
Mon, 21 Oct 2013 16:06:01 +0100 |
ARC is only supported with the non-fragile ABI. If you specify
-fobjc-runtime=gnustep and -fobjc-arc, then it should default to the equivalent
of -fobjc-runtime=gnustep-1.7. The rest of your code appears to be compiled
with the legacy (GCC-compatible) ABI (-fobjc-runtime=gnustep, with no version,
which is strongly discouraged).
I'd recommend copying how the packages are built on FreeBSD. The GNUstep and
libdispatch ports work out of the box in this configuration.
David
On 21 Oct 2013, at 15:16, Lloyd Sargent <lloyd.sargent@gmail.com> wrote:
> Basically, I followed the instructions here:
> http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux
>
> With the extra step of building the gui and back.
>
> If I build and run a non-gui program, all works well. Only when I add
> something that uses the gui, like the following:
>
> // 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;
> }
>
> I compile this with the following:
>
> clang `gnustep-config --objc-flags` `gnustep-config --objc-libs`
> -fobjc-arc -fobjc-runtime=gnustep -fblocks -lobjc -ldispatch -lgnustep-gui
> test.m
>
> It compiles and links with no errors.
>
> When I run it, however, it spits out the following ugly-gram:
>
> 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)
>
> I have assured myself that there is no other version of libobjc (this is on a
> virtual machine so I can go back redo my steps).
>
> Commenting out the following:
>
> // [NSApplication sharedApplication];
> // NSRunAlertPanel(@"Test", @"Wow it works!", @"OK", nil, nil);
>
> and everything compiles and runs, aside from the GUI obviously.
>
> How can I have two ABI's when I build everything from scratch? Do I need to
> configure the GUI differently? I've been puzzling over this for a couple of
> weeks.
>
> My goal is to have ARC, the GUI and (optionally) blocks.
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep
-- Sent from my brain