cmake in vsc doesn't find generator - visual-studio-code

I need help. I tried everything. I want build a project with cmake in C++ in visual studio code.
I always get this error message.
[variant] Loaded new set of variants
[kit] Successfully loaded 9 kits from C:\Users\beatb\AppData\Local\CMakeTools\cmake-tools-kits.json
[kit] Failed to parse cmake.exe:
SyntaxError: JSON5: invalid character 'M' at 1:1
at syntaxError (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:35543:17)
at invalidChar (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:35488:12)
at Object.value (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:34747:15)
at lex (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:34538:42)
at Object.parse (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:34485:17)
at readKitsFile (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:57032:26)
at async Object.getAdditionalKits (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:57088:48)
at async KitsController.readKits (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:57264:35)
at async Function.init (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:57208:9)
at async Function.init (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:55478:32)
at async CMakeToolsFolderController._addFolder (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:55727:22)
at async CMakeToolsFolderController.loadAllCurrent (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:55679:17)
at async ExtensionManager._init (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:54050:13)
at async Function.create (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:54102:9)
at async setup (c:\Users\beatb\.vscode\extensions\ms-vscode.cmake-tools-1.9.2\dist\main.js:55194:32)
at async Promise.all (index 0)
at async Promise.all (index 100)
at async Promise.all (index 1)
[proc] Executing command: C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -v
[main] Configuring folder: HelloWorld
[proc] Executing command: "C:\Program Files\Cmake\bin\cmake.exe" --no-warn-unused-cli -
DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -
DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -
DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe -
Hc:/Users/beatb/OneDrive/Documents/Programmieren/C++/HelloWorld -
Bc:/Users/beatb/OneDrive/Documents/Programmieren/C++/HelloWorld/build -G "MSYS Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error: CMake was unable to find a build program corresponding to "MSYS
Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
[cmake] CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
[cmake] CMake Error: CMAKE_AR was not found, please set to archive program.
[cmake] -- Configuring incomplete, errors occurred!
[main] Configuring folder: HelloWorld
[proc] Executing command: "C:\Program Files\Cmake\bin\cmake.exe" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe -Hc:/Users/beatb/OneDrive/Documents/Programmieren/C++/HelloWorld -Bc:/Users/beatb/OneDrive/Documents/Programmieren/C++/HelloWorld/build -G "MSYS Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
[cmake] CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
[cmake] -- Configuring incomplete, errors occurred!
[cmake] CMake Error: CMAKE_AR was not found, please set to archive program.
[main] Restarting the CMake driver after a generator change.
[proc] Executing command: C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -v
[cmakefileapi-driver] Removing c:/Users/beatb/OneDrive/Documents/Programmieren/C++/HelloWorld/build/CMakeCache.txt
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
[main] Restarting the CMake driver after a generator change.
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
[main] Restarting the CMake driver after a generator change.
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
[main] Restarting the CMake driver after a generator change.
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
[main] Restarting the CMake driver after a generator change.
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
[main] Restarting the CMake driver after a generator change.
[rollbar] Unhandled exception: Unhandled Promise rejection: quickStart Error: No usable generator found. {}
This is the the code in my settings.json
{
"files.autoSave": "afterDelay",
"kite.showWelcomeNotificationOnStartup": false,
"code-runner.executorMap": {
"c": "cd $dir && gcc *.c -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ *.cpp -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
},
"code-runner.runInTerminal": true,
"code-runner.ignoreSelection": true,
"cmake.configureOnOpen": true,
"cmake.cmakePath": "C:\\Program Files\\Cmake\\bin\\cmake.exe",
"cmake.additionalKits": [
"C:\\Program Files\\Cmake\\bin\\cmake.exe"
],
"cmake.generator": "mingw32-make"
}
The compiler I use is mingw. If I use the Visual Studio Build Tool as my kit everything works fine. I just have problems when I use GCC 10.3.0 x86_w64-mingw32.
I hope somebody can help me.

Found the error myself. I had to change the filename "mingw32-make.exe" (in the bin Folder of MinGW) into "make.exe". Now it works perfectly.

Related

vite:build-html EISDIR: illegal operation on a directory, read

`npm run build
hiddal.com#0.0.0 build
vite build
vite v4.1.1 building for production...
✓ 0 modules transformed.
[vite:build-html] EISDIR: illegal operation on a directory, read
file: C:/Users/hgale/alexanderhdev/Hiddal/hiddal.com/index.html
error during build:
Error: EISDIR: illegal operation on a directory, read
I still couldn't find solutions because I can't understand the error`

I cannot initialize my project on Visual Studio Code using the PlatformIO

I am using Visual Studio Code and added the PlatformIO IDE extension along with c/c++ to code for my board, which is a uPesy ESP32 Wrovoer DevKit with a Espressif IoT Developement framework. Everything matches my but when I click finish I get an error message:
The current working directory C:\Users\brownme1\Documents\PlatformIO\Projects\my_project will be used for the project.
The next files/directories have been created in C:\Users\brownme1\Documents\PlatformIO\Projects\my_project
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File
Resolving upesy_wrover dependencies...
Already up-to-date.
Updating metadata for the vscode IDE...
Error: Processing upesy_wrover (platform: espressif32; board: upesy_wrover; framework: espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/upesy_wrover.html
PLATFORM: Espressif 32 (6.0.0) > uPesy ESP32 Wrover DevKit
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-espidf # 3.50000.0 (5.0.0)
- tool-cmake # 3.16.4
- tool-esptoolpy # 1.40400.0 (4.4.0)
- tool-idf # 1.0.1
- tool-mconf # 1.4060000.20190628 (406.0.0)
- tool-ninja # 1.9.0
- toolchain-esp32ulp # 1.23500.220830 (2.35.0)
- toolchain-xtensa-esp32 # 11.2.0+2022r1
Reading CMake configuration...
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe -- broken
-- Configuring incomplete, errors occurred!
See also "C:/Users/brownme1/Documents/PlatformIO/Projects/my_project/.pio/build/upesy_wrover/CMakeFiles/CMakeOutput.log".
See also "C:/Users/brownme1/Documents/PlatformIO/Projects/my_project/.pio/build/upesy_wrover/CMakeFiles/CMakeError.log".
CMake Warning at C:/Users/brownme1/.platformio/packages/framework-espidf/tools/cmake/git_submodules.cmake:4 (message):
Git executable was not found. Git submodule checks will not be executed.
If you have any build issues at all, start by adding git executable to the
PATH and rerun cmake to not see this warning again.
Call Stack (most recent call first):
C:/Users/brownme1/.platformio/packages/framework-espidf/tools/cmake/idf.cmake:41 (include)
C:/Users/brownme1/.platformio/packages/framework-espidf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:2 (include)
CMake Error at C:/Users/brownme1/.platformio/packages/tool-cmake/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/Users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/brownme1/Documents/PlatformIO/Projects/my_project/.pio/build/upesy_wrover/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Users/brownme1/.platformio/packages/tool-ninja/ninja.exe cmTC_0ae29 && [1/2] Building C object CMakeFiles\cmTC_0ae29.dir\testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_0ae29.dir/testCCompiler.c.obj
C:\Users\brownme1\.platformio\packages\toolchain-xtensa-esp32\bin\xtensa-esp32-elf-gcc.exe -mlongcalls -Wno-frame-address -o CMakeFiles\cmTC_0ae29.dir\testCCompiler.c.obj -c testCCompiler.c
xtensa-esp32-elf-gcc.exe: fatal error: cannot execute 'c:/users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/11.2.0/../../../../xtensa-esp32-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
C:/Users/brownme1/.platformio/packages/framework-espidf/tools/cmake/project.cmake:342 (__project)
CMakeLists.txt:3 (project)
========================== [FAILED] Took 4.21 seconds ==========================
Please try to read the error carefully. It says you're missing git.
Git executable was not found. Git submodule checks will not be executed.
If you have any build issues at all, start by adding git executable to the
PATH and rerun cmake to not see this warning again.

Vscode : Command 'CMake: Configure' resulted in an error (No usable generator found)

When I am configuring the CMake for vscode,I encounter a very puzzling problem.I follow the steps of Microsoft's vscode official documentation to configure CMake for vscode,and everything is good.I can finish the 'F5' debugging operation and running the project in the vscode.
However,later while configuring vscode for cmake with "cmake.generator": "Ninja" and using the CMake:Configure command, vscode generates an error——
Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings. json, your Kit configuration or Path variable
The following output[1] of the CMake Tools Extension indicated that it tried to find the new CMake generator but not found.
Command 'CMAKE:Configure' result in an error (No usable generator found.)
[rollbar] Unhandled exception: Unhandled Promise rejection: configure Error: No usable generator found.
I read the CMake official doucument,searched the problem in google but I can't find out why.
[1] the detailed error prompts

Running Simulink produces make error

Opening a file in simulink and running it produces the following make error:
Making simulation target "ekf_trial_sfun", ...
/Applications/MATLAB_R2013a_Student.app/bin/mex -c -O -DMATLAB_MEX_FILE -I/Applications/MATLAB_R2013a_Student.app/stateflow/c/mex/include -I/Applications/MATLAB_R2013a_Student.app/stateflow/c/debugger/include ekf_trial_sfun.c
xcodebuild: error: SDK "macosx10.7" cannot be located.
xcrun: error: unable to find utility "clang", not a developer tool or in PATH
mex: compile of ' "ekf_trial_sfun.c"' failed.
gmake: *** [ekf_trial_sfun.o] Error 1
I have clang on my computer. Do I need to open up the mex .sh file and rename all the old operating system refences (10.6) to 10.10.4? I tried doing a find and replace and that didn't work.
The file was given to me by another engineer
I also get the warning: Some of the issues encountered during model compilation may be because this model was created in a previous release.

Can't use plugins for Cordova

Everytime I want to use a plugin I can't build a project and get this error:
$ cordova emulate ios
Generating config.xml from defaults for platform "ios"
Preparing ios project
Running on emulator for platform "ios" via command "/Users/jakob/Dropbox/Coding/+diplomarbeit/phonegap/rlb_cordova/platforms/ios/cordova/run" --emulator
/Users/jakob/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while emulating/deploying the ios project. ** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
2013-12-31 15:54:27.469 xcodebuild[10583:641b] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:78
Details: Failed to load dependencies output contents from ``/Users/jakob/Dropbox/Coding/+diplomarbeit/phonegap/rlb_cordova/platforms/ios/build/rlb_cordova.build/Debug-iphonesimulator/rlb_cordova.build/Objects-normal/i386/CDVDevice.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “CDVDevice.d” couldn’t be opened because there is no such file." UserInfo=0x7ff3ba0424e0 {NSFilePath=/Users/jakob/Dropbox/Coding/+diplomarbeit/phonegap/rlb_cordova/platforms/ios/build/rlb_cordova.build/Debug-iphonesimulator/rlb_cordova.build/Objects-normal/i386/CDVDevice.d, NSUnderlyingError=0x7ff3ba042590 "The operation couldn’t be completed. No such file or directory"}. User info: {
NSFilePath = "/Users/jakob/Dropbox/Coding/+diplomarbeit/phonegap/rlb_cordova/platforms/ios/build/rlb_cordova.build/Debug-iphonesimulator/rlb_cordova.build/Objects-normal/i386/CDVDevice.d";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\"";
}.
Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *__strong, F) [F = <lambda at /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:168:73>]
Thread: <NSThread: 0x7ff3ba041890>{name = (null), num = 9}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
The following build commands failed:
CompileC build/rlb_cordova.build/Debug-iphonesimulator/rlb_cordova.build/Objects-normal/i386/CDVDevice.o rlb_cordova/Plugins/org.apache.cordova.device/CDVDevice.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
at ChildProcess.<anonymous> (/Users/jakob/lib/node_modules/cordova/src/emulate.js:67:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
I only used the CLI and didn't mess with any config. Here I tried to install the device plugin like:
$ cordova plugin add org.apache.cordova.device
Fetching plugin from "org.apache.cordova.device"...
Starting installation of "org.apache.cordova.device" for android
Preparing android project
org.apache.cordova.device installed on android.
Starting installation of "org.apache.cordova.device" for ios
Preparing ios project
org.apache.cordova.device installed on ios.
Looks not too bad but however I can't build the project. Just when I remove the plugin with:
$ cordova plugin remove org.apache.cordova.device
Anyone else having this issues?
My Versions:
$ npm --version
1.3.14
$ node --version
v0.10.22
$ cordova --version
3.3.1-0.1.2
$ git --version
git version 1.8.3.4 (Apple Git-47)
I had the same problem, and I solved It creating the project with uppercase in the first letter of project name. Yes, it seems incredible, but this was the solution.