Режим intellisense windows msvc x64 несовместим с путем компилятора

Issue Type: Bug IntelliSense mode msvc-x64 is incompatible with compiler path. Steps to reproduce: 1> open a folder in vs code for windows and create a folder .vscode 2>enable this extension ...

Issue Type: Bug

IntelliSense mode msvc-x64 is incompatible with compiler path.
Steps to reproduce:
1> open a folder in vs code for windows and create a folder .vscode

2>enable this extension
https://github.com/Microsoft/vscode-cpptools.git

3> Set this as c_cpp_properties.json inside .vscode folder
»’
{
«configurations»: [
{
«name»: «Win32»,
«compilerPath»: «C:Program Files (x86)mingw-w64i686-8.1.0-posix-dwarf-rt_v6-rev0mingw32bing++.exe»,
«includePath»: [
«${workspaceFolder}/**»
],
«defines»: [
«_DEBUG»,
«UNICODE»,
«_UNICODE»
],
«intelliSenseMode»: «msvc-x64»
}
],
«version»: 4
}
»’
4> now set this in tasks.json
»’
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
«version»: «2.0.0»,
«tasks»: [
{
«type»: «shell»,
«label»: «g++.exe build active file»,
«command»: «C:Program Files (x86)mingw-w64i686-8.1.0-posix-dwarf-rt_v6-rev0mingw32bing++.exe»,
«args»: [
«-g»,
«${file}»,
«-o»,
«${fileDirname}${fileBasenameNoExtension}.exe»
],
«options»: {
«cwd»: «C:Program Files (x86)mingw-w64i686-8.1.0-posix-dwarf-rt_v6-rev0mingw32bin»
},
«problemMatcher»: [
«$gcc»
],
«group»: {
«kind»: «build»,
«isDefault»: true
}
}
]
}
»’
VS Code version: Code 1.44.0 (2aae1f2, 2020-04-07T23:31:18.860Z)
OS version: Windows_NT x64 10.0.18362

System Info

Item Value
CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 7.89GB (2.11GB free)
Process Argv C:UsersASUSvscodecodechef
Screen Reader no
VM 0%

Extensions: none
.

Hi @frenchiveruti . Both the IntelliSenseMode and the compilerPath settings are used by the C/C++ Extension to determine how to interpret the source code, to provide language services such as code navigation, colorization, etc.. The «msvc» IntelliSenseMode’s are specifically for the MSVC compiler («cl.exe»). So, the error is to inform you that the IntelliSenseMode and the compilerPath you have specified are incompatible. If your code is expected to compile using gcc, and you want gcc-specific language features to be allowed (not flagged as errors in the editor), you should use one of the «gcc» IntelliSenseMode’s.

The C/C++ Extension does not provide a build system. How are you building your project? The linux-like paths seem to be the result of your build system or compiler. Perhaps if you are using CMake or Make from MSYS64, they may output linux-like paths, as MSYS64 is a linux shell and would accept those paths. Or, perhaps the build of gcc you have installed is not intended to be used outside of MSYS64? The mingw64-w64 packages for MSYS64 should work properly when invoked outside of MSYS64.

What are valid values for the c_cpp_properties.json tag «intelliSenseMode» ?

It defaults to clang-x64, but I am compiling with g++ so is there another value I can use there? I can not find any documentation about it.

asked Sep 15, 2017 at 14:49

salbeira's user avatar

2

Because Artemy Vysotsky did not post his answer as an answer:

The documentation states that "msvc-x64" and "clang-x64" are the only possible values.

Sahin's user avatar

Sahin

81812 silver badges17 bronze badges

answered Sep 27, 2017 at 19:48

salbeira's user avatar

salbeirasalbeira

2,3055 gold badges25 silver badges38 bronze badges

1

When editing the .json configuration file, just type "intelliSenseMode": "" and let intelliSense itself help.

Actually you may use the option "intelliSenseMode": "${default}" to allow self selection.

As of today, the defaults are: clang-x64 for Mac; msvc-x64 for Windows; and gcc-x64 for Linux.

answered May 9, 2019 at 9:03

Fábio Lobão's user avatar

Fábio LobãoFábio Lobão

1611 silver badge11 bronze badges

I am getting this warning because of line number 16 enter image description here

Just change "intelliSenseMode": "windows-msvc-x64" to "intelliSenseMode": "windows-gcc-x64"

answered Jul 6, 2021 at 12:19

Shivam Goel's user avatar

Shivam GoelShivam Goel

3875 silver badges9 bronze badges

Since v0.25, 32 bit modes are supported. The valid options are msvc-x64, gcc-x64, clang-x64 and their 32 bit counterparts msvc-x86, gcc-x86, clang-x86. There’s also the ${default} option that Fábio Lobão mentions.

(Source: https://github.com/microsoft/vscode-cpptools/issues/2312)

answered Feb 18, 2020 at 15:49

Joel Santos Rico's user avatar

I was having the same problem, if you’re using Windows

I used «g++.exe»
enter image description here

Then I changed the «IntelliSense mode» to «windows-gcc-x64» to get rid of the warning
enter image description here

answered Jun 27, 2022 at 2:36

Manny's user avatar

MannyManny

335 bronze badges

0

Hovering on the intelliSenseMode in the file c_cpp_properties.json shows this documentation popup.

screenshot of popup on intelliSenseMode

It pretty much says that valid values have to be specified in the format <platform>-<compiler>-<architecture>. The older <compiler>-<architecture> variants are legacy modes and are converted automatically to the newer format based on the platform. So, some valid values can be

  1. linux-gcc-x64
  2. windows-msvc-x64
  3. macos-clang-x64

But when I checked in the documentation here it says the following.

screenshot of documentation

Conclusion

I would go with the contextual documentation since official documentation builds can lag behind.


Version Details

  • Version: 1.73.0
  • Electron: 19.0.17
  • Chromium: 102.0.5005.167
  • Node.js: 16.14.2
  • V8: 10.2.154.15-electron.0
  • OS: Linux x64 5.15.0-52-generic snap
  • Sandboxed: No
  • C/C++ Extension: v1.12.4

answered Nov 2, 2022 at 9:17

Dhwani Katagade's user avatar

Каковы допустимые значения для тега c_cpp_properties.json «intelliSenseMode»?

По умолчанию это clang-x64, но я компилирую с g ++, так что я могу использовать другое значение? Я не могу найти какую-либо документацию по этому поводу.

3 ответа

Лучший ответ

Потому что Артемий Высоцкий не опубликовал свой ответ как ответ

В документации говорится, что «msvc-x64» и «clang-x64» являются единственно возможными значениями.


8

salbeira
27 Сен 2017 в 19:48

Начиная с версии 0.25, поддерживаются 32-битные режимы. Допустимые параметры: msvc-x64, gcc-x64, clang-x64 и их 32-битные аналоги msvc-x86, gcc-x86, clang-x86. Также есть опция ${default}, о которой упоминает Фабио Лобао.

(Источник: https://github.com/microsoft/vscode-cpptools/issues/2312 )


0

Joel Santos Rico
18 Фев 2020 в 15:49

При редактировании файла конфигурации .json просто введите "intelliSenseMode": "" и позвольте самому intelliSense помочь.

На самом деле вы можете использовать опцию "intelliSenseMode": "${default}", чтобы разрешить самостоятельный выбор.

На сегодняшний день значения по умолчанию: clang-x64 для Mac; msvc-x64 для Windows; и gcc-x64 для Linux.


0

Fábio Lobão
9 Май 2019 в 09:03

-Ну, давайте посмотрим на проблемы, с которыми мы сталкиваемся:

Режим Intellisense MSVC-X64 не совместим с путем компилятора.

  • Давайте посмотрим на решение.


нам нужно только взять его здесьmsvc Изменить наgcc К

Вы можете увидеть решение проблем.


Интеллектуальная рекомендация

О Java Docking Wechat шаблон

Почему 80%кодовых фермеров не могут сделать архитектора? >>>     Недавно в проекте есть функция. После успешного оплаты заказа пользователям необходимо предоставить уведомление…

Hbase

1 документация HBASE 1,1 источник HBase 1.2 HBASE архитектура 1.2.1 Концепция HBase — это база данных — может предоставлять случайное чтение в режиме реального времени и запись данных HBase отличает…

Обучение ликвидации ссылки цикла

Создать ссылочный объект цикла Распечатайте вышеупомянутый объект A или B, получите бесконечный вложенный объект End (Release) Избыточная цитата вложена (для конкретных идей, см. Супер подробную запис…

Асинхронное уведомление

Асинхронное уведомление Предисловие 1. Асинхронный механизм уведомлений Два или четыре элемента В -третьих, что должно быть сделано на уровне приложения 1. Используйте сигнал, чтобы установить функцию…

Вам также может понравиться

Структура данных Java — двойной связанный список

Двусвязный список обеспечивает прямой и обратный обход всего связанного списка.Ключевой проблемой является то, что каждая ссылка имеет две ссылки на другие ссылки. Вместо одного первый указывает на сл…

Введение в структуру данных

Проще говоря, структура данных — это контейнер, в котором хранятся данные в определенной компоновке. Этот «макет» определяет, что структура данных эффективна для некоторых операций и неэфф…

I am trying to get Clang to work with VSCode. I’ve hit success on the terminal, but VSCode is still refusing to cooperate.

Clang on Windows by default targets x86_64-pc-windows-msvc, but the reason I’m using VSCode is I’m avoiding VS in the first place. The solution to this is to pass a target flag: --target=x86_64-w64-windows-gnu. This allows Clang to work with MinGW headers — on the terminal at least.

VSCode detects the presence of both Clang and MinGW-w64, and changing the Intellisense mode to windows-gcc-x64 allows it to work properly. However, changing the compiler path to Clang breaks Intellisense entirely — I’ve changed the Intellisense mode to windows-clang-x64 and windows-clang-x86, added a hard link at C:MinGW and C:mingw64 pointing at the MinGW installation, all to no avail. In all cases $PATH contains the MinGW bin directory, LLVM bin directory, and the MinGW hard link.

Any other ideas on what else I can try to get VSCode to recognize Clang?

Thank you for your time.

asked May 9, 2021 at 10:36

404 Name Not Found's user avatar

There is an easier why to install Clang on Windows without MSVC and it works with intellisense without problems.

go to https://www.msys2.org/ and install mysys2

then open mysys2 terminal and copy those commands to install Clang:

pacman -S mingw-w64-x86_64-clang

pacman -S mingw-w64-x86_64-clang-tools-extra

dont forget to add msys64mingw64bin to the SYSTEM PATH variable

Now Intellisense should work

I have also made a video about it if you want to check it : https://youtu.be/5OSO8IRlyXc

Reza Rahemtola's user avatar

answered Aug 5, 2021 at 23:01

adam's user avatar

adamadam

955 bronze badges

I am trying to get Clang to work with VSCode. I’ve hit success on the terminal, but VSCode is still refusing to cooperate.

Clang on Windows by default targets x86_64-pc-windows-msvc, but the reason I’m using VSCode is I’m avoiding VS in the first place. The solution to this is to pass a target flag: --target=x86_64-w64-windows-gnu. This allows Clang to work with MinGW headers — on the terminal at least.

VSCode detects the presence of both Clang and MinGW-w64, and changing the Intellisense mode to windows-gcc-x64 allows it to work properly. However, changing the compiler path to Clang breaks Intellisense entirely — I’ve changed the Intellisense mode to windows-clang-x64 and windows-clang-x86, added a hard link at C:MinGW and C:mingw64 pointing at the MinGW installation, all to no avail. In all cases $PATH contains the MinGW bin directory, LLVM bin directory, and the MinGW hard link.

Any other ideas on what else I can try to get VSCode to recognize Clang?

Thank you for your time.

asked May 9, 2021 at 10:36

404 Name Not Found's user avatar

There is an easier why to install Clang on Windows without MSVC and it works with intellisense without problems.

go to https://www.msys2.org/ and install mysys2

then open mysys2 terminal and copy those commands to install Clang:

pacman -S mingw-w64-x86_64-clang

pacman -S mingw-w64-x86_64-clang-tools-extra

dont forget to add msys64mingw64bin to the SYSTEM PATH variable

Now Intellisense should work

I have also made a video about it if you want to check it : https://youtu.be/5OSO8IRlyXc

Reza Rahemtola's user avatar

answered Aug 5, 2021 at 23:01

adam's user avatar

adamadam

955 bronze badges

Понравилась статья? Поделить с друзьями:
  • Редалер 2 скачать бесплатно на русском языке для windows 10
  • Режим intellisense windows gcc x64 несовместим с путем компилятора
  • Редакторы кода python для windows 10
  • Режим efi windows 10 как отключить
  • Редакторе локальных групповых политик windows 10