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. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Are you telling the linker that it should also include QuantLib? You can add the library to the linker options, or you can also add #include <ql/auto_link.hpp> to your code. Luigi On Tue, Jul 4, 2017 at 6:18 AM Andrew Leach <[hidden email]> wrote:
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
The errors seem to refer to d:\Users\Bob\Documents\Visual Studio 2015\Projects\MTF_Garch\MTF_Garch\QuantLib-vc141-mt-gd.lib, though, which is not the path you mention. Is it possible that you have another copy of the library there which for some reason is breaking your build?
Luigi On Tue, Jul 4, 2017 at 10:41 AM Andrew Leach <[hidden email]> wrote:
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
The only other thing I can think of trying (assuming you added the <ql/auto_link.hpp> header) is rebuilding your project from scratch. Luigi P.S. Please keep the mailing list in cc. Someone there might have better ideas. On Tue, Jul 4, 2017 at 7:54 PM Andrew Leach <[hidden email]> wrote:
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi, Thanks once again for your suggestion. It may be the final solution to my problem. I've done what you said and recreated the solution in VS2017. I've now got a load of compiler errors that I don't understand so will battle on through these and try and understand them myself. I'll have to see if I get the linker problems again. Thanks once again for your kind replies. ------- Internet communications are not secure and therefore Andrew Leach does not accept legal responsibility for the contents of this message. The information contained in this email is private, personal and confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. This email and any attachments have been automatically scanned for viruses prior to dispatch, but we make no warranty that they are free from computer viruses. You are advised to check all emails and attachments using your own anti virus software before opening or executing them. On 5 July 2017 at 15:24, Luigi Ballabio <[hidden email]> wrote:
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |