C2011 ‘vc_sttributes::YesNoMaybe’ “ ‘enum’ type redefinition RESOLVED
-
Three people have posted and chewed me out for editing the Visual Studio files. Still, as I perceived this thread, the core problem has been ignored. I had a project that compiled an ran and started getting errors where it should not. Why might I get YesNoMaybe redefined? If the code that has that is prefixed with #pragma once, why might Visual Studio re-read that file that is knows is has already read, then declare the item redefined. The error appears, from my perspective, to be a failure of #pragma once to not do fulfill its intended purpose. I will be adding option /showIncludes and see if I can derive any information from that. Just as a side comment, these kinds of problems would probably be much easier to deal with if I could find anyone else around here that uses Visual Studio. Edit: I edited more information into my original post at the bottom.
Thank you for your time
Hi, Just a Comment. I assume that you understand that each 'C' or 'CPP' File, gets compiled into One and only One '.obj' module. The Linker stitches all those 'Obj' modules together, to create an Exe or DLL, your Target. In doing so, your program needs to link with other libraries and DLL's already on the system. For Instance, your program uses the keyboard, and uses the mouse. You did not have to write the code inside your program to track the mouse movements, register the clicks, etc. That was already done by Microsoft, and comes as part of the Windows Package. Now, Microsoft wrote all that stuff, but, the compiler needs to know what is available from Microsoft, I.e.: the function and other specifications that the Windows API provides. These specifications are included in the System Headers. If you change these specifications to suit your own purpose, well, it Might work if you also 'Re Compiled Windows' If you mess with your system header files, you are actually telling your compiler that Windows works different than that it actually does. Your Compiler caught you out, and stopped you writing a disaster. #include files do not make your program larger, at most it slows down your compiler and linker
All Software Engineers should Learn and Train Machine and Assembly Language, so as to really Understand how a computer Works Bram van Kampen