user3248621
user3248621

Reputation: 3

Visual Studios 2012 Changing Runtime Library causes Link Errors, with C++

I have written program that's uses Fico's BCL C++ library to solve an optimization problem. When I compile and run the code in visual studio 2012 with the /MDd runtime library, everything compiles fine and the program runs.

I need to be able to run the program on another machine where I cannot install visual studio. When I try to compile my program with the /MD runtime library I get the following link error:

error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: char const & __thiscall std::_String_const_iterator<class std::_String_val<struct std::_Simple_types<char> > >::operator*(void)const " (??D?$_String_const_iterator@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@QBEABDXZ)

When I use the /MT runtime library I get an even longer list of linker errors.

I am new to writing and compiling code in c++ and visual studio. Am I missing something obvious? The Fico software is installed on target system.

Upvotes: 0

Views: 331

Answers (1)

egur
egur

Reputation: 7970

These errors mean that you link with the debug version of the BCL library.

In release mode, link with the Release version of BCL.

Upvotes: 1

Related Questions