Compiling Objective-C project on Linux (Ubuntu) Compiling Objective-C project on Linux (Ubuntu) linux linux

Compiling Objective-C project on Linux (Ubuntu)


It's right. In both cases you did not include Fraction.m in your list of files to be compiled, so it can't find the implementation of the class Fraction

From the comment, this command works

gcc `gnustep-config --objc-flags` -o main *.m -lobjc -lgnustep-base


I am not an expert at writing the make files like that, I find simply typing the following works on ubuntu quite well:

gcc -I /usr/include/GNUstep/ -I /usr/include/mysql -L /usr/lib/GNUstep/\    -lgnustep-base -lmysqlclient\    -g -ggdb\    -fconstant-string-class=NSConstantString -o test *.m

I am using it on this project:

http://github.com/uptecs/SmsgateDelivery/

If the above GCC command does not work you have not installed enough packages, use apt-cache to search for more gcc and objective c packages to install (I just installed more packages that looked relevant at random until it worked)


the make file:

include ${GNUSTEP_MAKEFILES}/common.makeAPP_NAME=FractionFraction_HEADERS = Fraction.hFraction_OBJC_FILES = main.m Fraction.minclude ${GNUSTEP_MAKEFILES}/application.make