Quantlib runtime issues

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

Quantlib runtime issues

Mathias Zetterqvist
Hi, I want to use quantlib in an external application. This
application will call an dll where I
want to put my own code. So I have this settings

External application <-> My own dll <-> Quantlib (<-> Boost)

When I compile the quantlib everything works fine, untill i want to
use the lib:s from the code compiled as a dll (the "My own dll" part).
The runtime library differs and this will cause a linking error. The
lib I have for Quantlib (which i compiled with the default settings)
is QuantLib-vc71-mt-sgd-0_3_9.lib but the linker looking for
QuantLib-vc71-mt-gd-0_3_9.lib.

I tried to do like this

1) Switched the runtime library in quantlib to "Multi-threaded debug
DLL" (/MDd switch) and
 compiled the code. Boost have several different libs depending on the
runtime, so hopefully the correct
 boost library will be used.

2) Quantlib will compile with this settings but the name on the file
will still be the same. Then
i changed the name on the file.

3) I could now link this library to my dll application and everything
worked fine.

But is this a good way (or even a possible way) to sovle the linking
issue? Will I run into problems later?

Has anyone else used QuantLib in a dll? Which settings shall I use to
make it possible?

Best regards
/Mathias Zetterqvist


Reply | Threaded
Open this post in threaded view
|

Re: Quantlib runtime issues

eric ehlers
Hi Mathias

QuantLib comes with preset configurations e.g.

    configuration - Debug
    run-time library - Multi-Threaded Debug
    output - QuantLib-vc71-mt-sgd-0_3_9.lib

and the one you want

    configuration - Debug MTDLL
    run-time library - Multi-Threaded Debug DLL
    output - QuantLib-vc71-mt-gd-0_3_9.lib

Your approach of editing the 'Debug' configuration ought to work but
it's easier to just use 'Debug MTDLL' instead.

Also
- You should be able to use QuantLib in a DLL and your approach looks OK
- QuantLib depends only on the Boost header files not the libs
(QuantLib test-suite depends on the boost libs)

Regards
Eric

On 6/19/05, Mathias Zetterqvist <[hidden email]> wrote:

> Hi, I want to use quantlib in an external application. This
> application will call an dll where I
> want to put my own code. So I have this settings
>
> External application <-> My own dll <-> Quantlib (<-> Boost)
>
> When I compile the quantlib everything works fine, untill i want to
> use the lib:s from the code compiled as a dll (the "My own dll" part).
> The runtime library differs and this will cause a linking error. The
> lib I have for Quantlib (which i compiled with the default settings)
> is QuantLib-vc71-mt-sgd-0_3_9.lib but the linker looking for
> QuantLib-vc71-mt-gd-0_3_9.lib.
>
> I tried to do like this
>
> 1) Switched the runtime library in quantlib to "Multi-threaded debug
> DLL" (/MDd switch) and
>  compiled the code. Boost have several different libs depending on the
> runtime, so hopefully the correct
>  boost library will be used.
>
> 2) Quantlib will compile with this settings but the name on the file
> will still be the same. Then
> i changed the name on the file.
>
> 3) I could now link this library to my dll application and everything
> worked fine.
>
> But is this a good way (or even a possible way) to sovle the linking
> issue? Will I run into problems later?
>
> Has anyone else used QuantLib in a dll? Which settings shall I use to
> make it possible?
>
> Best regards
> /Mathias Zetterqvist
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&opclick">http://ads.osdn.com/?ad_idt77&alloc_id492&opclick
> _______________________________________________
> Quantlib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>