discuss-gnustep
[Top][All Lists]
Advanced

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

Re: How to Build a Tool that uses NSApplication...


From: Christopher Armstrong
Subject: Re: How to Build a Tool that uses NSApplication...
Date: Mon, 06 Nov 2006 14:24:00 +1100

> Basically I want to build a tool that does some processing of NSImages
> (but never displays them).
> 
> Okay, but when I use the following make file:
> 
> include $(GNUSTEP_MAKEFILES)/common.make
> 
> TOOL_NAME = ObjectiveC
> ObjectiveC_OBJC_FILES = ObjectiveC.m
> 
> include $(GNUSTEP_MAKEFILES)/tool.make
> 
> I get a bunch of linker messages:
> 
> Making all for tool ObjectiveC...
>  Linking tool ObjectiveC ...
> ./shared_obj/ObjectiveC.o: In function `main':
> ObjectiveC.m:(.text+0x5b4): undefined reference to
> `NSFontAttributeName'
> ObjectiveC.m:(.text+0x647): undefined reference to
> `NSForegroundColorAttributeName'
> ./shared_obj/ObjectiveC.o:(.data.rel+0x4): undefined reference to
> `__objc_class_name_NSApplication'
> ./shared_obj/ObjectiveC.o:(.data.rel+0x8): undefined reference to
> `__objc_class_name_NSWindow'
> ./shared_obj/ObjectiveC.o:(.data.rel+0xc): undefined reference to
> `__objc_class_name_NSView'
> ./shared_obj/ObjectiveC.o:(.data.rel+0x10): undefined reference to

As you can see, you're linker failures are all in AppKit classes. The
makefile scripts for tools (tool.make) does not  attempt to link against
the AppKit library (gnustep-gui), hence all the "undefined references".
I think there is a macro defined called $(GUI_LIBS) which can be added
to the linker command line which references gnustep-gui. Check the
makefile manual for more details (you put in a line like
ADDITIONAL_TOOL_LIBS = $(GUI_LIBS) ).

Alternatively, you could try and link it as an applications
(application.make), but as you said, this is purely a tool and not a
application. I also think that service.make may cause linking against
gnustep-gui (I'm not sure though). I wrote some additions quite a while
ago to the makefile manual which details alot of this stuff at
http://gnustep-docs.sf.net. Which reminds me, does gnustep want these
additions? I have copyright assignment. There is also substantial AppKit
documentation there which I'm currently not maintaining.

Cheers
Chris
carmstrong at fastmail [dot] com [dot] au
-- 
  Christopher Armstrong
  carmstrong@fastmail.com.au





reply via email to

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