Pratik Vinod
Pratik Vinod

Reputation: 41

Unable to resolve configuration with compilerPath "/usr/bin/gcc". Using "cl.exe" instead

I am doing flutter devlopement and in that there are some modules of c++. These were the automatically generated files of c++. When i open the project in vscode it shows this message in output. I have installed c++ compiler mingw64 and included path in the environment variables.

I tried changing configurations of c++ intellisense. As per this.. #include errors detected. Please update your includePath in visual studio code

Upvotes: 3

Views: 47302

Answers (4)

james
james

Reputation: 1

I had the same problem. here is how you fix it.

  1. fresh install vs code. (remove the extensions)
  2. add the extension mql tools
  3. in mql tools setting add the path to the mql4 folder... not the include folder.
  4. in mql tools setting add the path to the mql5 folder... not the include folder.
  5. in mql tools setting add the path to the mt4 meta editor.
  6. in mql tools setting add the path to the mt5 meta editor 64.
  7. click the "file" tab (top left) and click "open folder".
  8. Open the mql4 folder. (if done correctly it will have vscode config now).
  9. close the folder. (Ctrl + K + F).
  10. Open the mql5 folder. (if done correctly it will have vscode config now).
  11. close the folder. (Ctrl + K + F).
  12. click the "file" tab (top left) and click "open folder".
  13. Open the mql4 folder.
  14. click the "file" tab (top left) and click "open folder".
  15. Open the mql5 folder. (both the mql4 and 5 folders should be in your workspace now.
  16. click the "file" tab (top left) and click "Save Workspace As".
  17. Name your workspace for example "mql development".
  18. save your workspace somewhere, don't worry it's just a link that tells vs code what folders are in your workspace.

Now your good to go.

Upvotes: 0

Ram MAHESHWARI
Ram MAHESHWARI

Reputation: 1

press ctrl+shift+p then search c_cpp_properties.json while adding the path to this file make sure that address has to '2 back slash' instead of 'one back slash'

{
"configurations": [       
    {
        "name": "arm",
        "includePath": [
            "${workspaceFolder}/**"
        ],
        "defines": [
            "_DEBUG",
            "UNICODE",
            "_UNICODE"
        ],
        "windowsSdkVersion": "10.0.22621.0",
        "cStandard": "c99",
        "intelliSenseMode": "linux-gcc-arm",
        "compilerPath": "C:\MinGW\bin\gcc.exe"
    }
],
"version": 4

your file may not have compiler path section so make it

Upvotes: 0

Muhammad Nour
Muhammad Nour

Reputation: 2327

I had a similar issue with a different compiler and this helped me to solve my issue: configure intellisense crosscompilation

this is my c_cpp_properties.json

{
"configurations": [       
    {
        "name": "arm",
        "includePath": [
            "${workspaceFolder}/**"
        ],
        "defines": [
            "_DEBUG",
            "UNICODE",
            "_UNICODE"
        ],
        "windowsSdkVersion": "10.0.22621.0",
        "cStandard": "c99",
        "intelliSenseMode": "linux-gcc-arm",
        "compilerPath": "C:\\arm_toolchain\\13.2.Rel1-mingw-w64-i686-arm-none-eabi\\bin\\arm-none-eabi-gcc.exe"
    }
],
"version": 4

}

Upvotes: 0

Elias Alter
Elias Alter

Reputation: 31

I had a similar issue, but with a different compiler (ti-cgt-arm) and I ended up setting

"compilerPath": ""

in the corresponding configuration in c_cpp_properties.json and then added all necessary entries in "includePath": (to fix the intellisense errors for #includes). I found the hints in the VS Code CPP documentation:

compilerPath (optional) The full path to the compiler you use to build your project, for example /usr/bin/gcc, to enable more accurate IntelliSense. The extension will query the compiler to determine the system include paths and default defines to use for IntelliSense.

Putting "compilerPath": "" (empty string) will skip querying a compiler. This is useful if a specified compiler doesn't support the arguments that are used for the query, as the extension will default back to any compiler it can find (like Visual C). Leaving out the compilerPath property does not skip the query.

Apparently, when the compiler doesn't respond to VS Code as it expects (because the compiler doesn't support the arguments passed by VS Code), VS Code decides to use a fallback compiler.

Upvotes: 1

Related Questions