example linking error in Dev-C++ 4.9.9.2

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

example linking error in Dev-C++ 4.9.9.2

Benjamin Janson
Hi,

I am a new to the QuantLib and I am not very experienced in using Dev-C++,
so I hope that is no rediculous question.

With the help of Pauls instructions in the article:

"Installing QuantLib using Dev-C++ 4.9.9.2: WORKING"

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.

Thanks a ton in advance.

Cheers Benjamin


Reply | Threaded
Open this post in threaded view
|

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

Luigi Ballabio
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.