You are not logged in.

#1 2014-06-06 23:44:50

ProtoTech
Member
Registered: 2014-05-31
Posts: 25

Error Compiling Obj-C with GNUstep

I have installed gnustep-base and gnustep-gui from the Arch repo's and am attempting to try and compile some basic Obj-C code, although I am running into errors.

First of all, I am following this tutorial http://www.techotopia.com/index.php/Ins … C_on_Linux

Here are the commands that I am using and their output in the terminal.

[devin@devin-linux Objc]$ gcc 'gnustep-config --objc-flags' -lgnustep-base hello.m -o hello
gcc: error: gnustep-config --objc-flags: No such file or directory
 
 
[devin@devin-linux Objc]$ gnustep-config --objc-flags
-MMD -MP -D_FORTIFY_SOURCE=2 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -pthread -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fgnu-runtime -fconstant-string-class=NSConstantString -fexec-charset=UTF-8 -I. -I/home/devin/GNUstep/Library/Headers -I/usr/include -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/include -I/usr/include -I/usr/lib/libffi-3.0.13/include/ -I/usr/lib/libffi-3.0.13/include -I/usr/include/libxml2 -I/usr/include/p11-kit-1
[devin@devin-linux Objc]$ 

Also, here is the code that I am attempting to execute.

#include <Foundation/Foundation.h>
 
int main(int argc, const char* argv[]) {
	NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
	NSLog(@"Hello world");
	[pool drain];
	return 0;
}

Last edited by ProtoTech (2014-06-07 00:04:42)

Offline

#2 2014-06-08 09:54:36

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: Error Compiling Obj-C with GNUstep

In

gcc 'gnustep-config --objc-flags' -lgnustep-base hello.m -o hello

the ' have to be replaced by backtics `

gcc `gnustep-config --objc-flags` -lgnustep-base hello.m -o hello

Offline

#3 2014-06-08 22:01:12

ProtoTech
Member
Registered: 2014-05-31
Posts: 25

Re: Error Compiling Obj-C with GNUstep

Stefan Husmann wrote:

In

gcc 'gnustep-config --objc-flags' -lgnustep-base hello.m -o hello

the ' have to be replaced by backtics `

gcc `gnustep-config --objc-flags` -lgnustep-base hello.m -o hello

Ah, thank you. This is where copying and pasting catches up to you.

Offline

Board footer

Powered by FluxBB