"#include " statement ineffective?

Geoff geoff at red8.org
Fri Jun 18 21:00:29 BST 2004


Charles Trois wrote:
> I am a beginner with kdevelop-3.0.2 (kde-3.2.1, Yellow Dog Linux 3.0.1 on a
> G4 iMac).
> 
> I have been trying to compile a program borrowed from the XLib programming
> handbook. It contains only one source file, called basicwin.c.
> 
> What I did was to build the hello c application and, using the Automake
> Manager, replace the existing source by basicwin.c.
> 
> The compilation gives this error:
> 
> basicwin.o(.text+0x50): In function `main':
> */home/moi/kdev/ex3/src/basicwin.c:51: undefined reference to
> `XAllocSizeHints'
> 
> and many more such lines.
> 
> This surprises me, as XAllocSizeHints is defined in X11/Xutil.h and
> basicwin.c contains
> 
> #include <X11/Xlib.h>
> #include <X11/Xutil.h>
> 
> I have checked that these files are in their proper places in /usr/includes.

The .h files declare the functions you're using, but you need to tell 
the linker to use the libraries with the relavent function definitions. 
  In KDevelop, with the automake manager, you would right-click on your 
build target, then choose "Options."  Under the "Libraries" tab, you 
need to add the appropriate libraries to the link options.

-g

> What goes wrong here? Am I using kdevelop improperly?
> 
> All hints gracefully received.
> 
> Charles
> 
> 
> 
> 
> -
> to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
> unsubscribe »your-email-address«

-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list