Community
cancel
Showing results for 
Search instead for 
Did you mean: 
steven
Beginner
135 Views

Missing C Runtime functions - Intel Compiler 2019 update 3 + VS 15.9.11

Hi,

I'm having some issues with missing wide string crt functions when compiling with /Qstd=C++17 in x64 release builds.  I'm getting errors like 

ipo_2060819obj3.obj : : error LNK2019: unresolved external symbol wmemcmp referenced in function main

It works fine with narrow strings or when targetting C++14.  I'm using the latest Intel Compiler 2019 update 3 and Visual Studio 2017 15.9.11.  I've attached a minimal example of the problem.

 

Thanks for your help.

Steven.

 

 

 

 

 

0 Kudos
4 Replies
Viet_H_Intel
Moderator
135 Views

It could be that  VS2017 15.9.11 hasn't been supported by ICL 19.0 Update 3. Does it work if you use older VS2017 (ex:15.8)?

Thanks,

 

steven
Beginner
135 Views

I think I first spotted the problem with 15.9.4 and then upgraded to the latest to see if that helped.

Tolmie__Shane
Beginner
135 Views

I've also run into the same issue. A complex project builds just fine with MSVC in Debug+Release. Builds fine in Debug with Intel Compiler v19.0.

Fails in Release with Intel Compiler v19.0:

Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK2019    unresolved external symbol wmemcmp referenced in function "public: class fmt::v6::basic_format_arg<class fmt::v6::basic_format_context<class std::back_insert_iterator<class fmt::v6::internal::buffer<wchar_t> >,wchar_t> > __cdecl fmt::v6::basic_format_context<class std::back_insert_iterator<class fmt::v6::internal::buffer<wchar_t> >,wchar_t>::arg(class fmt::v6::basic_string_view<wchar_t>)" (?arg@?$basic_format_context@V?$back_insert_iterator@V?$buffer@_W@internal@v6@fmt@@@std@@_W@v6@fmt@@QEAA?AV?$basic_format_arg@V?$basic_format_context@V?$back_insert_iterator@V?$buffer@_W@internal@v6@fmt@@@std@@_W@v6@fmt@@@23@V?$basic_string_view@_W@23@@Z)    FlatbufCppLib    FlatbufCppLib\ipo_3661235obj3.obj :    1    

 

Tolmie__Shane
Beginner
135 Views

I ended up "solving" the problem by migrating everything from wstring to string. Then it compiled in Release mode (it was only compiling in Debug mode before that).

I think it's only an issue if two wstring objects are compared with an "==" sign.

For any existing functions that required wstring, I used the following.

#pragma once

#include <string>
#include <filesystem>

using namespace std;

inline wstring StringToWString(const string &s)
{
	wstring wsTmp(s.begin(), s.end());
	return wsTmp;
}

inline string WStringToString(const wstring &s)
{
	string wsTmp(s.begin(), s.end());
	return wsTmp;
}