Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C2011 ‘vc_sttributes::YesNoMaybe’ “ ‘enum’ type redefinition RESOLVED

C2011 ‘vc_sttributes::YesNoMaybe’ “ ‘enum’ type redefinition RESOLVED

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiohelpquestioncsharp
21 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B bkelly13

    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

    B Offline
    B Offline
    Bram van Kampen
    wrote on last edited by
    #21

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups