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

"Error: type name is not allowed" after updating Visual Studio 2019

khabar
Novice
6,821 Views

Hi

I'm using Intel Parallel Studio XE 2020 with Visual Studio 2019.

Last night, after visual studio update to 16.7.1, when I compile any code having STL algorithm, a compilation error will occur. the sample code is:

 

 

#include <vector>
#include "algorithm"
int main()
{
    std::vector<int> data(100000);
    auto it = std::find(data.begin(), data.end(), 100);
    return 0;
}

 

 

And the compilation message is:

 

 

1>------ Build started: Project: Project3, Configuration: Debug Win32 ------
1>Source.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\xutility(63): error : type name is not allowed
1> return __builtin_bit_cast(_To, _Val);
1> ^
1>
1>compilation aborted for Source.cpp (code 2)
1>Done building project "Project3.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

 

Please guide me.

Thanks

0 Kudos
1 Solution
khabar
Novice
6,614 Views
The problem has been solved by updating to 19.1 update 2.
Thank you

View solution in original post

0 Kudos
8 Replies
AbhishekD_Intel
Moderator
6,777 Views

Hi,

Will you please confirm the compiler you are using. It seems that you are using Visual Studio Compiler.

Please select Intel C++ Compiler and try debugging your code. And let us know if you are having the same issue.



Warm Regards,

Abhishek


0 Kudos
khabar
Novice
6,765 Views

Thank you AbhishekD_Intel

But I exactly selected Intel Compiler (as shown in the image), with Visual Studio compiler it will run without any problem.

intel.jpg

 

When I switch to Visual Studio Build-Tolls 16.5, it works fine!

Do you think that is a bug in Intel Parallel Studio which is not compatible with new implementations in Visual Studio?

Note: I looked at the xutility file in two version of Visual Studio, It has major changes.

0 Kudos
Viet_H_Intel
Moderator
6,751 Views

Yes, that is most likely the case. It is not recommended to use VS versions that released after the compiler released (built) date, because we won't be able to validate that VS versions prior to releasing our compiler. Thanks,


0 Kudos
AbhishekD_Intel
Moderator
6,719 Views

Hi,

Hope the details provided by Viet helped you. Please give us an update if you get the reason for such behavior.


Thank You,

Abhishek


0 Kudos
AndrewC
New Contributor III
6,639 Views

I tested the sample code with the latest version of Visual Studio 2019 (16.7.2) and with both Intel Compiler 19.0 and 19.1 Update 2

For sure 19.0 has some issues with the STL ( it is easy to patch the STL files to fix that) but I have no problems with 19.1 Update 2 and your sample code compiles without error using I9.1 Update 2.

You need to attach your vcxproj file to the bug report.

0 Kudos
AndrewC
New Contributor III
6,623 Views

Actually its very likely the OP was NOT using 19.1 Update 2

0 Kudos
khabar
Novice
6,615 Views
The problem has been solved by updating to 19.1 update 2.
Thank you
0 Kudos
AbhishekD_Intel
Moderator
6,579 Views

Hi,


As your issue is resolved we won't be monitoring this thread anymore. Kindly raise a new thread if you need further assistance


Warm Regards,

Abhishek


0 Kudos
Reply