Qt World Summit: Register Today!

__cplusplus is still defined in MinGW 32-bit C compiler

  • I'm trying to add a simple GUI on top of a C library that I have. I added the source and header files directly to the project, it's not a precompiled library. But when I try to build one of the C files, I have a problem because the __cplusplus macro is still defined as 1. I have a common header file that uses STDC_VERSION and __cplusplus to figure out what standard header files to include for all my projects. When compiling a C file, __cplusplus should be 0 or undefined, not 1. I haven't had this issue in any other compiler. Is there some way to get this macro turned off?

  • Lifetime Qt Champion

    hi @JonSchell,

    • can you show us your project file for investigation?
    • is the file compiled with gcc or g++ ( compile log)?

    thanks and regards

Log in to reply