help-gplusplus
[Top][All Lists]
Advanced

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

Re: undefined reference to '__cxa_pure_virtual' while using -nodefaultli


From: Paul Pluzhnikov
Subject: Re: undefined reference to '__cxa_pure_virtual' while using -nodefaultlibs
Date: Wed, 28 Sep 2005 14:59:06 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"Hansen" <bluesboys@-remove-this-hotmail.com> writes:

> As far as I've understod, this happens when using g++ 
> for compiling and gcc for linking, but I'm using g++ in both cases.

It happens when correct libraries are not present on the link line.
One way to arrange for that is to link with 'gcc', anouther is to
link with 'g++ -nodefaultlibs'

> It seems as if I can remove the problem if I remove the 
> option -nodefaultlibs from my linker options, but I doesn't want to do that, 
> due to size constraints.

I think you don't understand how linking works, and that your
"size constaints" argument is bogus: if you have a successful link,
removing -nodefaultlibs from the link line should have almost
no effect on the final exe size.

> Is there anyhow I can keep the -nodefaultlibs and 
> get rid of the undefined reference to '__cxa_pure_virtual' ?

Sure: just add the libraries that you removed with '-nodefaultlibs'
back on to the command line :)

FYI, __cxa_pure_virtual is in libstdc++.{a,so}

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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