Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7943 Discussions

compilation error because wchar_t is recognized as same as unsigned int.

Wei_Guo
Beginner
406 Views
Hi,

I am new to Intel C++ Compiler. Now I am using ntel Parallel Composer Update 1 (Package ID: composer_update1.063), inside of Visual Studio 2008 Version 9.0.30729.1 SP.

When I am using the Intel C++ Compiler, I got following error:

error: function "ss::system::Safe_To_Copy_Mem(const wchar_t={unsigned short} *, wchar_t={unsigned short} *)" has already been defined

Could you let me know how I can set Intel Compiler to let it treat the wchar_t and unsinged short as different type? I tried to google this and search the forum but I didn't get the good answer.

Best regards,

Wei
0 Kudos
2 Replies
Judith_W_Intel
Employee
407 Views
Quoting - weiguo
Hi,

I am new to Intel C++ Compiler. Now I am using ntel Parallel Composer Update 1 (Package ID: composer_update1.063), inside of Visual Studio 2008 Version 9.0.30729.1 SP.

When I am using the Intel C++ Compiler, I got following error:

error: function "ss::system::Safe_To_Copy_Mem(const wchar_t={unsigned short} *, wchar_t={unsigned short} *)" has already been defined

Could you let me know how I can set Intel Compiler to let it treat the wchar_t and unsinged short as different type? I tried to google this and search the forum but I didn't get the good answer.

Best regards,

Wei

Use the option /Zc:wchar_t

From the icl -help page:

/Zc:arg1[,arg2]
specify standard conformance for the following arguments:
forScope[-] enforce standard compliance in for loop scope
wchar_t[-] specify that wchar_t is a native data type
auto[-] enforce compliance to the new standard meaning for auto

Judy
0 Kudos
Wei_Guo
Beginner
407 Views

Use the option /Zc:wchar_t

From the icl -help page:

/Zc:arg1[,arg2]
specify standard conformance for the following arguments:
forScope[-] enforce standard compliance in for loop scope
wchar_t[-] specify that wchar_t is a native data type
auto[-] enforce compliance to the new standard meaning for auto

Judy

Hi Judy,

Thanks a lot for the help. It works. The interesting thing is that some of team member didn't run into this problem but others did with same source code and project settings. I checked the .vcproj file and I did find the "TreatWChar_tAsBuiltInType="true" in that file. I thought that this should implicitly add the parameter /Zc:wchar_t.
0 Kudos
Reply