#ifdef __cplusplus -> Where is this defined?

Sysprogs forums Forums VisualGDB #ifdef __cplusplus -> Where is this defined?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7169
    tonofsteel
    Participant

    This is probably a basic question but I am not able to find where this is defined.  I created two identical projects with the only difference being that the “generate source code” radio button at the first screen of the wizard was selected as “.c” for one project and “.cpp” for another.  However this is defined in the .cpp project and it is not defined in the .c project.

    On one page I read the following:

    You can instruct Visual C++ to compile as C instead of C++ by setting the “Compile As” project setting.

    Right click on your project and select “Properties”.  Then select “Configuration Properties” -> “C/C++” -> “Advanced”.  You will see an option called “Compile As”.  Here you can select either “Compile as C++ Code (/TP)” or “Compile as C Code (/TC)”.  Selecting “Compile as C Code” will do precicely that.

     

    However this option is not available in VisualGDB projects.  How am I able to see where this is defined and be able to change it?

    #7183
    support
    Keymaster

    Hi,

    VisualGDB uses a different build mechanism, so forcing the C++ files to be treated as C would involve adding “-x c” to CXXFLAGS. However, we would recommend simply renaming your .cpp file to a .c file to avoid further problems.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.