Noch einmal Projektsuchpfade "UNDEFINED REFERENCE"

August Hörandl august.hoerandl at gmx.at
Wed Jul 11 22:40:13 BST 2001


Marco Keuthen wrote:
> 
> Hallo,
> 
> ich habe folgende Problematik.
> Ich habe eine Klasse erstellt (*.h und *.cpp) Die files befinden sich nicht
> in einem Suchpfad.
> Zwischenzeitlich habe ich unter MENÜ-PROJEKTOPTIONEN - COMPILER mittels
> -I<Pfad> den Pfad dahin gelegt.
> Er kompiliert das auch, denn es befindet sich eine .o Datei in den
> Verzeichnis.
> 
> Aber er scheint die .cpp Datei nicht zu finden, denn alle Methoden der
> Klasse, deren Deklaration in der .h Datei steht, lassen sich nicht benutzen
> (UNDEFINDED REFERENCE)
> Sobald ich die Methoden inline in der .h Datei habe, klappt es.
> 
> Irgendwie scheint er die .cpp Datei zu ignorieren.

okay - this is an english speaking list

short english summary of the question:
marco has used -Ipath to specify some .h and .cpp files - the problem:
the
.cpp files aren't compiled and linked


answer:
long:
first: -I specifies the include path - where to search for .h 
 files -- nothing else

c/c++ is a little "stupid": the compiler and the linker don't have any
idea which .h and .cpp files belong together - you use for example
strlen() 
and include <string.h> -- put there is no string.c or string.o within
the include directory or anywhere else

that why there is a project in kdevelop which results in a Makefile with 
this info

next: just because there is an .o file somewhere it may be the wrong
one: 
other compiler options, wrong defines, wrong compile (gcc, g++), cross 
compiled, there is a lot to be wrong

thats why kdevelop likes all source files to be in the project directory
-
and not distributed everywhere 

short:
you have to copy the files into the projekt directory: try
kdevelop/project/
add existing files - which copies the files to the right place and
includes
them into the project; so they are compiled and linked into the result

hth
Gustl

-- 
                         \|/
                        (o o)
-----*schnippel*----oOO--(_)--OOo----*knabber*----*reiss*----*fetz*--
August Hörandl                                 august.hoerandl at gmx.at

-
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