#include <Foundation/Foundation.h> #include <HelloWorld/HelloWorld.h> int main (void) { [HelloWorld printMessage]; return 0; }(We invoke the printMessage method of the HelloWorld class, then exit.).
We write our usual GNUmakefile (but including GNUmakefile.preamble):
include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = HelloWorldTest HelloWorldTest_OBJC_FILES = main.m include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make
Then, here is the GNUmakefile.preamble, in which we tell the make package about the library we want to link against:
HelloWorldTest_TOOL_LIBS += -lHelloWorld
If you have correctly installed the library HelloWorld, this is all you need to do. If you needed to link against more than one library, you would simply put them on the same line, as in:
HelloWorldTest_TOOL_LIBS += -lHelloWorld -lHelloMoonwhich links against the two libraries HelloWorld and HelloMoon.
If HelloWorld were an application, you would need to use
HelloWorldTest_GUI_LIBS += -lHelloWorld(the difference is GUI instead of TOOL).