Enable C11 in Visual GDB

Sysprogs forums Forums VisualGDB Enable C11 in Visual GDB

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  support 3 weeks, 1 day ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29892

    vico
    Participant

    I have C++ project in my Visual Studio 19 that builds binary for my Raspberry Pi with help of cross compiler and Visual GDB. I’m trying to use enum class that is part of C11 standard:

    enum class OperationRegime { ECO, MAX };

    Got error while build:

    error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    enum class OperationRegime { ECO, MAX };
    ^

    How to enable C11 standart in Visual C++ Visual GDB project?

     

    <GCCVersion>8.3.0</GCCVersion>
    <GDBVersion>8.2.1</GDBVersion>
    <BinutilsVersion>2.31.1</BinutilsVersion>

    • This topic was modified 3 weeks, 2 days ago by  vico.
    #29894

    support
    Keymaster

    Hi,

    That would be normally in the project-level settings under the C/C++ -> Advanced tab. Please refer to this page for more details.

    #29895

    vico
    Participant

    I added options below, but still have the same problem.

    Language Standart for C files     C11 (-std=c11)

    Language Standart for C++ files    C++11 (-std=c++11)

    Attachments:
    You must be logged in to view attached files.
    #29897

    support
    Keymaster

    Most likely, your toolchain does not support this language feature, or there is an error in the source file, or you need to select a different language standard.

    Our best advice would be to try dumping the gcc command line used by VisualGDB as described here and verifying that the -std option gets passed to gcc.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.