fatal error LNK1104: cannot open file 'QuantLib-vc80-mt-0_9_7.lib'

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

fatal error LNK1104: cannot open file 'QuantLib-vc80-mt-0_9_7.lib'

Norman Fung-2
hello

I created a simple WIN32 console application. I keep getting this error as soon as I add this line to main.cpp:
#include <ql/quantlib.hpp>
The linker error is:

Error    29    fatal error LNK1104: cannot open file 'QuantLib-vc80-mt-0_9_7.lib'    SimpleWIN32Console   

I have already included ...
STEP 1: Tools\Options\VC++ Directories\Library Files\
                I:\dev\QuantLib\QuantLib-0.9.7\lib

STEP 2: Tools\Options\VC++ Directories\IncludeFiles\
                I:\dev\QuantLib\QuantLib-0.9.7

I then checked lib folder, there exists the following two files (but not the one in linker error message):
(file-a) QuantLib-vc80-mt-s-0_9_7.lib
(file-b) QuantLib-vc80-mt-sgd-0_9_7.lib

What's with "-s-" and "-sgd-" in lib file name? And where in "QuantLib" can I find reference to "QuantLib-vc80-mt-0_9_7.lib"? I cheated and manage to successfully compile and get rid of linker problem by renaming "file-a" to "QuantLib-vc80-mt-0_9_7.lib", thought there should be a more elegant way to do this!

Thanks!

Norman

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

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: fatal error LNK1104: cannot open file 'QuantLib-vc80-mt-0_9_7.lib'

Luigi Ballabio
On Fri, 2009-01-02 at 18:49 +0800, Norman Fung wrote:

> I created a simple WIN32 console application. I keep getting this
> error as soon as I add this line to main.cpp:
> #include <ql/quantlib.hpp>
> The linker error is:
>
> Error    29    fatal error LNK1104: cannot open file
> 'QuantLib-vc80-mt-0_9_7.lib'    SimpleWIN32Console    
>
> I then checked lib folder, there exists the following two files (but
> not the one in linker error message):
> (file-a) QuantLib-vc80-mt-s-0_9_7.lib
> (file-b) QuantLib-vc80-mt-sgd-0_9_7.lib

You compiled the static-runtime version of QuantLib. In your application
project, instead, the run-time settings tell the linker to look for the
shared-runtime version. You'll have to sync the two; either recompile
QuantLib in Release mode (no static runtime), or change your project
settings (in the properties, they're under Configuration Properties /
C/C++ / Code Generation; choose "Multi-threaded DLL".)

Luigi

P.S. The other issue you have with multiply-defined symbols is probably
due to your using a renamed library, thus pulling in two versions
(static and shared) of the runtime.


--

Olmstead's Law:
After all is said and done, a hell of a lot more is said
than done.



------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: fatal error LNK1104: cannot open file 'QuantLib-vc80-mt-0_9_7.lib'

Eric Ehlers-2
Hi All,

Quoting Luigi Ballabio <[hidden email]>:

> On Fri, 2009-01-02 at 18:49 +0800, Norman Fung wrote:
>> I created a simple WIN32 console application. I keep getting this
>> error as soon as I add this line to main.cpp:
>> #include <ql/quantlib.hpp>
>> The linker error is:
>>
>> Error    29    fatal error LNK1104: cannot open file
>> 'QuantLib-vc80-mt-0_9_7.lib'    SimpleWIN32Console
>>
>> I then checked lib folder, there exists the following two files (but
>> not the one in linker error message):
>> (file-a) QuantLib-vc80-mt-s-0_9_7.lib
>> (file-b) QuantLib-vc80-mt-sgd-0_9_7.lib
>
> You compiled the static-runtime version of QuantLib. In your application
> project, instead, the run-time settings tell the linker to look for the
> shared-runtime version. You'll have to sync the two; either recompile
> QuantLib in Release mode (no static runtime), or change your project
> settings (in the properties, they're under Configuration Properties /
> C/C++ / Code Generation; choose "Multi-threaded DLL".)
>
> Luigi
>
> P.S. The other issue you have with multiply-defined symbols is probably
> due to your using a renamed library, thus pulling in two versions
> (static and shared) of the runtime.

More background on these issues is available at the following link:

http://quantlib.org/objecthandler/conventions.html

Regards,
Eric


------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: fatal error LNK1104: cannot open file 'QuantLib-vc80-mt-0_9_7.lib'

Norman Fung-2
hello

Just managed to compile+run the examples as well!

Thanks guys

Norman

On Fri, Jan 2, 2009 at 9:46 PM, <[hidden email]> wrote:
Hi All,


Quoting Luigi Ballabio <[hidden email]>:

On Fri, 2009-01-02 at 18:49 +0800, Norman Fung wrote:
I created a simple WIN32 console application. I keep getting this
error as soon as I add this line to main.cpp:
#include <ql/quantlib.hpp>
The linker error is:

Error    29    fatal error LNK1104: cannot open file
'QuantLib-vc80-mt-0_9_7.lib'    SimpleWIN32Console

I then checked lib folder, there exists the following two files (but
not the one in linker error message):
(file-a) QuantLib-vc80-mt-s-0_9_7.lib
(file-b) QuantLib-vc80-mt-sgd-0_9_7.lib

You compiled the static-runtime version of QuantLib. In your application
project, instead, the run-time settings tell the linker to look for the
shared-runtime version. You'll have to sync the two; either recompile
QuantLib in Release mode (no static runtime), or change your project
settings (in the properties, they're under Configuration Properties /
C/C++ / Code Generation; choose "Multi-threaded DLL".)

Luigi

P.S. The other issue you have with multiply-defined symbols is probably
due to your using a renamed library, thus pulling in two versions
(static and shared) of the runtime.

More background on these issues is available at the following link:

http://quantlib.org/objecthandler/conventions.html

Regards,
Eric



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

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users