I have many templates in my project. Everything is running fine but I've been getting this warning many times for a long time now. Should I keep ignoring it or should I use #pragma warning(disable : 4199)
?
Why do I have warning "C4199 two-phase name lookup is not supported for C++/CLI, C++/CX, or openmp"?
Asked
Active
Viewed 1.4k times
12

phuclv
- 37,963
- 15
- 156
- 475

BioAbner J
- 503
- 1
- 4
- 13
-
1What happens, if you use the switch `/Zc:twoPhase-` like the warning suggests? – Simon Jun 27 '19 at 06:32
-
1Find more info here: https://learn.microsoft.com/en-en/cpp/build/reference/zc-twophase?view=vs-2019 – Simon Jun 27 '19 at 06:36
-
2@Simon [Fixed link](https://learn.microsoft.com/cpp/build/reference/zc-twophase?view=vs-2019). Basically, the C++/CLI, C++/CX and openmp variants of the compiler do not support two-phase name lookup. Sorry. – Raymond Chen Jun 27 '19 at 06:49
1 Answers
25
Ok Thanks to Simon and Raymond's article I was able to solve it. I no more have that warning anywhere in my code. Just added the command as the article describes at it's very bottom.
Here's an image of where exactly I added the command for those like me that might have trouble finding it.

phuclv
- 37,963
- 15
- 156
- 475

BioAbner J
- 503
- 1
- 4
- 13
-
10I ran into this because my CLR project had [`/permissive-`](https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=vs-2019) set under All Options > Additional Options. Nowadays, when you create a C++ project through Visual Studio, it will automatically set `/permissive-`, _unless_ it's a CLR project. – yxrkt Aug 19 '20 at 22:59
-
3I found this option under "C/C++"/Language as the option "Conformance mode", with the values Default, Yes (/permissive-) and No (/permissive). Selecting Default solved the problem for me. – Phil Jollans Aug 01 '21 at 20:17