[Top][All Lists]

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

Re: Error: undefined reference to

From: Karthik Kumar
Subject: Re: Error: undefined reference to
Date: Thu, 04 Nov 2004 16:39:03 -0800
User-agent: Mozilla Thunderbird 0.8 (Windows/20040913)

Ben Rennigen wrote:

"Guy Harrison" <> schrieb im Newsbeitrag

...but not supplied the code body (definition). This may be because you've
not written it at all or because you've not passed the object-file/lib
containing the definition to the linker.

this may be the error - I compile the code with:

"g++ prog_complex.cpp -o prog_complex"

g++ -o prog_complex complex.cpp prog_complex.cpp

(assuming complex.cpp contains the implementation of
complex class that you were mentioning ).

The GNU linker expects the symbols to be arranged this way.
The most independent library comes first. The least
independent library comes last.

So there are no information about any object file or lib. I think my
compile - commandline isn't correct, how can I tell the compiler/linker to
link the object file of the file containing my complex-class implementation?

Thanks a lot

  Karthik.      .
  ' Remove _nospamplz from my email to mail me. '

reply via email to

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