- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I failed to build my project (under Windows 7 x64, VS2012 Update 2) that uses a rarely used /Zc:wchar_t- flag.
I have created a sample to reproduce this issue:
[cpp]
#include <iostream>
int main(int, char* [])
{
std::cout << 5;
return 0;
}
[/cpp]
If I build it with the following flags I have a linkage error:
[bash]
> icl /Zc:wchar_t- /O2 /MD /EHsc main.cpp
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.2.190 Build 20130514
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
30 DAY EVALUATION LICENSE
main.cpp
icl: NOTE: The evaluation period for this product ends on 5-jul-2013 UTC.
Microsoft (R) Incremental Linker Version 11.00.60315.1
Copyright (C) Microsoft Corporation. All rights reserved.
-out:main.exe
main.obj
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::_Yarn<unsigned short>::~_Yarn<unsigned short>(void)" (__imp_??1?$_Yarn@G@std@@QEAA@XZ) referenced in function "class std::numpunct<char> const& __cdecl std::use_facet<class std::numpunct<char> >(class std::locale const &)" (??$use_facet@V?$numpunct@D@std@@@std@@YAAEBV?$numpunct@D@0@AEBVlocale@0@@Z)
main.exe : fatal error LNK1120: 1 unresolved externals
>
[/bash]
I have found two workarounds for this problem. The first is to disable inline functions expansion (adding /Ob0 flag) and the second is to disable C++ exceptions (remove /EHsc flag).
[bash]
>icl /Zc:wchar_t- /O2 /MD /EHsc /Ob0 main.cpp
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.2.190 Build 20130514
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
30 DAY EVALUATION LICENSE
main.cpp
icl: NOTE: The evaluation period for this product ends on 5-jul-2013 UTC.
Microsoft (R) Incremental Linker Version 11.00.60315.1
Copyright (C) Microsoft Corporation. All rights reserved.
-out:main.exe
main.obj
>icl /Zc:wchar_t- /O2 /MD main.cpp
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.2.190 Build 20130514
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
main.cpp
Microsoft (R) Incremental Linker Version 11.00.60315.1
Copyright (C) Microsoft Corporation. All rights reserved.
-out:main.exe
main.obj
[/bash]
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
did you try to use a _MBCS macro
Yes, but neither _MBCS nor _UNICODE change the build result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
but since you have a workaround I would proceed with it
Ok, as a workaround we chose to disable C++ exceptions though it is not very good solution because it needs some non-trivial code modifications.
Finally found in VS 2010 in:
xlocale
xlocinfo
xutility
I think that problem lies in xlocinfo header (VS2012) since this is the only file that instantiates _Yarn<wchar_t> (used for weekday and month names)
It would be nice if you contact Microsoft since xlocale is Not Intel's header
The reason I created this thread on Intel's forum is that Microsoft's compiler successfully compiles this sample (and whole huge application):
[bash]
> cl /Zc:wchar_t- /O2 /MD /EHsc main.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60315.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
Microsoft (R) Incremental Linker Version 11.00.60315.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
main.obj
>
[/bash]
So I think this problem is on compiler (not linker) side.
I hope that Intel software engineers will also look at the problem.
I agree. It would be great if you forward this issue to Intel engineers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
this is a correction:
Although it looked like the problem has been fixed with 14.0, the root cause might still be there. It also appears with the Microsoft Visual Studio* compiler:
https://connect.microsoft.com/VisualStudio/feedback/details/817221/yarn-wchar-t-specialization-does-not-link-if-zc-wchar-t-is-specified
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got email recently that the Microsoft team has finally fixed this, the issue will be fixed in the VS2015 RTM.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page