oursgris
oursgris

Reputation: 2882

Statically link C++ 2010 failed

My goal is to avoid the installation of Microsoft C++ 2010 by statically link it. Because I don't know if that package will be installed on all the customer computers and his IT department doesn't allow the installation of software.

One other alternative would be to avoid the use of administrative privilege. (extract dll in the same directory that my program for example)

I found one possible solution http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/ab187afb-3af0-44ba-a03c-dde9e5208a1a/ and I tryied the parameter /MT.

I've 2 errors :

Erreur 1 error LNK2019: symbole externe non rÚsolu __CrtDbgReportW rÚfÚrencÚ dans la fonction "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z) C:\Users\philippe\Downloads\Portable Devices COM API Sample\C++\libcpmtd.lib(stdthrow.obj) WpdApiSample

Erreur 2 error LNK1120: 1 externes non rÚsolus C:\Users\philippe\Downloads\Portable Devices COM API Sample\C++\Debug\WpdApiSample.exe 1 1 WpdApiSample

Am I in the good way ? And how can I resolve that problem ?

Upvotes: 0

Views: 138

Answers (2)

Didac Perez Parera
Didac Perez Parera

Reputation: 3814

/MT for release configuration, /MTd for debug

Upvotes: 1

Emilio Garavaglia
Emilio Garavaglia

Reputation: 20730

The documentation of _CrtDbgReportW at the "requirement" section says:

Libraries: Debug versions of C run-time libraries only.

It means that such function are not present in the release version of the libraries, hence, the release version of your code should not call them.

According to this table may be you shold use /MTd so that you will link to the static debug version.

Upvotes: 2

Related Questions