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

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

Related

Swift error on Windows: invalidManifestFormat: Missing or empty JSON output from manifest compilation

I've installed Swift 5.6.1 on my Windows 10 machine, including all the necessary Visual Studio components, but I can't seem to build anything. Even just running the following set of commands in git bash results in an error:
mkdir swiftTest
cd swiftTest
swift package init --type executable
swift build
Specifically, the swift build command gives the following errors:
warning: Failed creating default cache location, Error Domain=NSCocoaErrorDomain Code=256 "(null)"
'swiftTest': error: invalidManifestFormat("Missing or empty JSON output from manifest compilation for swiftTest", diagnosticFile: nil)
The error message seems surprisingly rare -- the top google results were the source of the program that generated that error, and an unrelated error with similar wording from a ReactJS application.
Do I just have to add some flags to the swift build command, or is there something else wrong with my setup?
In my case what fixed it was invoking the command from a Visual Studio Developer Command prompt.

How to config CDT debug for cygwin?

I am new to eclipse CDT with cygwin. I just created a HelloWorld C++ project.
The built exe works in cygwin.
If I click the exe in file in file explorer, it says that it can not find cygwin1.dll. This error can be resolved by adding C:\cygwin64\bin to the Path env variable.
If I try to debug directly, I got the following errors:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/WINDOWS/system32/C:/Users/Cheng_g15klso/Documents/Proj/HelloWorld/C:/Users/Cheng_g15klso/Documents/Proj/HelloWorld/Debug/HelloWorld.exe, (error 2).
The above diagnosis seems to point to lacking of C:\cygwin64\bin, so I add C:\cygwin64\bin to Path env variable in the env var tab of the debug config, but the result is the same.
My questions:
How to solve this issue?
Where to find a list of error to decode error 2?
It seems that the latest gdb above version 9.2-1 is wrong: https://www.eclipse.org/forums/index.php/t/1105969/
I have downgrade my gdb and gcc for cgywin to cure the issue

Unable to debug React Native using VSCode

Fresh init of a RN project with a fresh copy of React Native Full Pack in VSCode. I'm unable to get this new project to debug, but am able to get other projects to debug using the same methods. I've tried recreating the project and still no dice. I can use react-native run-android in a command prompt to get it to debug, but not VSCode. I keep getting this error:
events.js:167
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, lstat 'c:\Users\user\Documents\repos\app\android\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\android\support\asynclayoutinflater'
Emitted 'error' event at:
at NodeWatcher.<anonymous> (c:\Users\user\Documents\repos\app\node_modules\metro\node_modules\sane\src\node_watcher.js:291:16)
at c:\Users\user\Documents\repos\app\node_modules\graceful-fs\polyfills.js:282:31
at FSReqWrap.oncomplete (fs.js:158:21)
[Error] Error: Error while executing command 'react-native.cmd run-android --no-packager': Error while executing command 'react-native.cmd run-android --no-packager' (error code 101)
I've also tried running the packager first, but it still default to a --no-packager run.
Deleting and reinstall NPM packages seems to work some of the time. But a better way to fix this problem is to run gradlew.bat clean from inside the android folder of the RN directory, then rerun the packager and restart the app.
install NodeWatcher.
use this command in windows : npm install node-watch
also try this.
You can also clean your build cache and gradle cache.
For more detail about how to do it, check this article: How to clear gradle cache

New VSCode extension can't find vscode

Why does a new VSCode extension created with yeoman generator immediately not find vscode when starting debug?
Clean install of node, yeoman, and generator "code".
While I can continue to debug with this error, why isn't vscode found? Is it extraneous if debugging actually works?
Type Ctrl+` to get the console and then npm i whereupon you will get a message similar to this
Detected VS Code engine version: ^1.31.0 Found minimal version that
qualifies engine range: 1.31.0 Fetching vscode.d.ts from:
https://raw.githubusercontent.com/Microsoft/vscode/7c66f58312b48ed8ca4e387ebd9ffe9605332caa/src/vs/vscode.d.ts
vscode.d.ts successfully installed!
After that things should be hunky dory.

Mongodb Error on running phpunit test

I tried to run mongdodb's driver test using phpunit as stated at http://www.php.net/manual/en/mongo.testing.php but it seems to have a problem with a MongoInt32Test.php filew.
# phpunit tests/mongosuite.php
Warning: require_once(MongoInt32Test.php): failed to open stream: No such file or directory in C:\Documents and Settings\owner\Desktop\mongo-php-driver\tests\MongoSuite.php on line 4
Fatal error: require_once(): Failed opening required 'MongoInt32Test.php' (include_path='.;\programming_tools\xampp-portable\php\PEAR') in C:\Documents and Settings\owner\Desktop\mongo-php-driver\tests\MongoSuite.php on line 4
I am using a php_mongo-1.3.1-5.4-vc9.dll and running mongodb 2.0.8 in windows xp. Anybody knows how to fix this? I can't find MongoInt32Test.php anywhere.
The PHPUnit tests in the extension are legacy tests and are no longer supported. I created a ticket, PHP-695, to remind us to remove mention of them from the documentation. All extension tests are phpt files, and instructions for executing them are documented in the GitHub repository.