GNUstep CoreBase Library 0.2
Compiling Applications

The information in this page describes how to compile application that make use of functionality provided GNUstep CoreBase Library.

To compile tools and/or application that make use of the GNUstep CoreBase Library, you will need tell the compiler where to find the header files, and the linker to use library and where it is located. Most modern compilers allow you to do this in a single command. For example, to compile a simple 'hello world' program you would type the following:

cc -I/path/to/header/files/ hello.c -L/path/to/library/ -lgnustep-corebase -o hello

Where cc is the C Compiler. If GNUstep CoreBase was installed to a standard location you can omit the -I and -L options.

To compile an application using GNUstep Make, simply add -lgnustep-corebase to $(NAME)_LIBRARIES_DEPEND_UPON. An example GNUmakefile for a simple 'hello world' program using GNUstep CoreBase would be:

include $(GNUSTEP_MAKEFILES)/common.make
CTOOL_NAME = hello
$(CTOOL_NAME)_C_FILES = hello.c
$(CTOOL_NAME)_LIBRARIES_DEPEND_UPON = -lgnustep-corebase
include $(GNUSTEP_MAKEFILES)/ctool.make

For more information about how to create GNUstep Make makefiles, visit the Make Utility manual.