Re: example linking error in Dev-C++ 4.9.9.2

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/example-linking-error-in-Dev-C-4-9-9-2-tp3905p3906.html

On 07/12/2005 04:54:03 PM, Benjamin Janson wrote:

>
> I compiled the QuantLib version 0.3.9 and 0.3.8 without any problems.
>
> Then I tried to compile the examples (also with Pauls compiler flags)
> and they compiles fine but the linker printed the following error
> (AmericanOption.dev):
>
> .... (more vtable warnings)
>   [Warning] duplicate section
> `.rdata$_ZTVN8QuantLib16DiscretizedAssetE[vtable for
> QuantLib::DiscretizedAsset]' has different size
>   [Linker error] undefined reference to
> `QuantLib::detail::operator<<(std::ostream&,
> QuantLib::detail::percent_holder const&)'
>   [Linker error] undefined reference to
> `QuantLib::detail::operator<<(std::ostream&,
> QuantLib::detail::percent_holder const&)'
> ....(lot more Linker errors)
>
> When I compile it as static Library (instead of as Console
> Application) it works just fine. Any ideas are appreciated.

Creating a static library just works because it skips linking.

I'll try to reproduce the error, but at first sight it looks like a  
library mismatch to me. Are you sure you're not, say, #including the  
header files from 0.3.9 and linking with the library from 0.3.8?

Later,
        Luigi

----------------------------------------

Humphrey's Requirements Uncertainty Principle:
        For a new software system, the requirements will not be  
completely known until after the users have used it.