Newbie - Unable to compile object c with GNUStep

I have a question related to this. Unable to compile Objective-C using Gnustep in windows

I am trying to compile my first c application on Windows. Hello.m file (all files created in Visual Studio)

#import <../Program Files/GNUstep/System/Library/Headers/Foundation/Foundation.h>

int main(int argc, const char* argv[])
{
    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
    NSLog(@"Hello from Hello.m!");

    [pool release];
    return 0;
}

To compile it, I have a GNUmake file in the same directory:

include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = hello
YourProg_OBJC_FILES = hello.m
include $(GNUSTEP_MAKEFILES)/tool.make

As I understand it, when I run the make command, the GNUmakefile will be executed.

When I do this in the GNUStep shell, I get an error

GNUmakefile:1 *** missing separator. Stop.

I tried adding a tab to the first line. It did nothing. Yes, I'm sure this is a tab, not a space.

+3
source share
4 answers

. Notepad ++ GNUmake. Notepad ++ - UTF8. make.exe MINGW32, , ANSI.

, , ANSI.

+3

make make , , , .

: http://www.gnu.org/software/automake/manual/make/Error-Messages.html:

, make make , . GNU make (:, =, ..), , . , .

:

gcc -o hello hello.m -I/c/GNUstep/GNUstep/System/Library/Headers \
    -L /c/GNUstep/GNUstep/System/Library/Libraries -lobjc -lgnustep-base \
    -fconstant-string-class=NSConstantString
+1

Foundation.h. #import <Foundation/Foundation.h>.

makefile , . make msys Windows? Windows, , , msys, GNUstep.

gcc , , SO > .

+1

GNUmake, YourProg_OBJC_FILES hello_OBJC_FILES,

include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = hello
hello_OBJC_FILES = hello.m
include $(GNUSTEP_MAKEFILES)/tool.make

,

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

The gnustep-config command , such as pkg-config , can print the compilation and layout options for gcc.

0
source

Source: https://habr.com/ru/post/1787236/


All Articles