[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Howto write GNUmakefile.preamble with using C API

From: Jaroslav Joska
Subject: RE: Howto write GNUmakefile.preamble with using C API
Date: Tue, 22 Jul 2008 12:21:36 +0200 (CEST)

I created new directory, copied two files (test.m and GNUmakefile) and after 
tried again to gmake command. It work's without errors. But still I can't run 
./obj/test. Segmentation Fault. I absolutely don't understand it.

# gmake messages=yes
This is gnustep-make 2.0.5. Type 'make print-gnustep-make-help' for help.
Making all for tool test...
cd .; \
        /usr/GNUstep/System/Library/Makefiles/mkinstalldirs ./obj
gcc test.m -c \
-DDEBUG -fno-omit-frame-pointer -DGSWARN -DGSDIAGNOSE -Wno-import -g 
-fno-strict-aliasing -fgnu-runtime -I/usr/local/include/mysql 
-fno-strict-aliasing -pipe -fconstant-string-class=NSConstantString -I. 
-I/usr/local/include -I/root/GNUstep/Library/Headers 
-I/usr/GNUstep/Local/Library/Headers -I/usr/GNUstep/System/Library/Headers \
               -o obj/test.o
test.m:3: warning: return type defaults to `int'
test.m: In function `main':
test.m:19: warning: implicit declaration of function `exit'
test.m:38: warning: control reaches end of non-void function
gcc  -rdynamic      -pthread -fgnu-runtime -o obj/test \
                ./obj/test.o \
-L/usr/GNUstep/Local/Library/Libraries -L/usr/GNUstep/System/Library/Libraries  
-L/usr/local/lib -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm   
-lgnustep-base   -pthread -lobjc   -lm

> > If you want to migrate it to Objective-C, then rename your test.c file to
> > test.m, and slightly modify your GNUmakefile:
> > include $(GNUSTEP_MAKEFILES)/common.make
> > TOOL_NAME = test
> > test_OBJC_FILES = test.m
> > ADDITIONAL_OBJCFLAGS += $(shell mysql_config --cflags)
> > ADDITIONAL_TOOL_LIBS += $(shell mysql_config --libs)
> > include $(GNUSTEP_MAKEFILES)/tool.make
> > 
> > It doesn't work
> > [...]
> > test.c:1:19: warning: mysql.h: No such file or directory
> > [...]
> Something is going wrong here - it was supposed to be compiling test.m here,
> not test.c ;-)
> I suggest when you try to switch to Objective-C, create a new empty 
> directory, 
> and put only test.m and your GNUmakefile in there.  Make sure to do all 
> changes 
> to the GNUmakefile, then try again.
> Let me know if that works :-)
> Thanks

reply via email to

[Prev in Thread] Current Thread [Next in Thread]