Andrew Leach
2017-07-04 04:14:57 UTC
Hi,
I'm relatively new to debugging C++ code, espcially with external libraries
so my appologies if this is trvial.
I'm trying to link my code to QuantLib.
The boost (1.64) and QuantLiv (1.10) on Visual Studio 2017 Community on
Windows 10 went fine, no errors and built both the Debug and Release
versions of QuantLib.
However, when I'm linking my program I'm getting the follwoing errors:
Severity Code Description Project File Line Suppression State
Error LNK1120 5 unresolved externals MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\Release\MTF_Garch.dll 1
Warning LNK4075 ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
MTF_Garch d:\Users\Bob\Documents\Visual Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(date.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(linesearchbasedmethod.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(conjugategradient.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(armijo.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(linesearch.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(endcriteria.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(constraint.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(leastsquare.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(simplex.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\MTF_Garch.obj 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(date.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(errors.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(garch.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(conjugategradient.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(armijo.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(linesearch.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(constraint.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(leastsquare.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(simplex.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(linesearchbasedmethod.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(date.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(errors.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(garch.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(endcriteria.obj)
1
Error LNK2001 unresolved external symbol __imp___calloc_dbg MTF_Garch
d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(date.obj)
1
Error LNK2001 unresolved external symbol __imp___free_dbg MTF_Garch
d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\msvcprtd.lib(locale0_implib.obj) 1
Error LNK2001 unresolved external symbol __imp___malloc_dbg MTF_Garch
d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\msvcprtd.lib(locale0_implib.obj) 1
NB. The directory structure is the old VS105 directory structure but the
project has been correctly migrated to 2017.
Everything that I do to fix this issue doesn't seem to work.
I'm including headers
#include <ql/quantlib.hpp>
#include <ql/models/volatility/garch.hpp>
in my code.
Any suggestions on how to fix this please?
TIA.
I'm relatively new to debugging C++ code, espcially with external libraries
so my appologies if this is trvial.
I'm trying to link my code to QuantLib.
The boost (1.64) and QuantLiv (1.10) on Visual Studio 2017 Community on
Windows 10 went fine, no errors and built both the Debug and Release
versions of QuantLib.
However, when I'm linking my program I'm getting the follwoing errors:
Severity Code Description Project File Line Suppression State
Error LNK1120 5 unresolved externals MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\Release\MTF_Garch.dll 1
Warning LNK4075 ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
MTF_Garch d:\Users\Bob\Documents\Visual Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(date.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(linesearchbasedmethod.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(conjugategradient.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(armijo.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(linesearch.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(endcriteria.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(constraint.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(leastsquare.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(simplex.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\MTF_Garch.obj 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(date.obj)
1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(errors.obj) 1
Error LNK2001 unresolved external symbol __imp___CrtDbgReportW
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(garch.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(conjugategradient.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(armijo.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(linesearch.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(constraint.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(leastsquare.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(simplex.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(linesearchbasedmethod.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(date.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(errors.obj) 1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(garch.obj)
1
Error LNK2001 unresolved external symbol __imp___invalid_parameter
MTF_Garch d:\Users\Bob\Documents\Visual
Studio
2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(endcriteria.obj)
1
Error LNK2001 unresolved external symbol __imp___calloc_dbg MTF_Garch
d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib(date.obj)
1
Error LNK2001 unresolved external symbol __imp___free_dbg MTF_Garch
d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\msvcprtd.lib(locale0_implib.obj) 1
Error LNK2001 unresolved external symbol __imp___malloc_dbg MTF_Garch
d:\Users\Bob\Documents\Visual
Studio 2015\Projects\MTF_Garch\MTF_Garch\msvcprtd.lib(locale0_implib.obj) 1
NB. The directory structure is the old VS105 directory structure but the
project has been correctly migrated to 2017.
Everything that I do to fix this issue doesn't seem to work.
I'm including headers
#include <ql/quantlib.hpp>
#include <ql/models/volatility/garch.hpp>
in my code.
Any suggestions on how to fix this please?
TIA.