Bad CMake executable "". Is it installed or settings contain the correct path (cmake.cmakePath)? - Pixhawk 4 Development - visual-studio-code

I want to complete the setup in Visual Studio Code for Pixhawk 4 development. So I followed the steps given in this documentation below. I also installed the Cygwin Toolchain previously.
https://dev.px4.io/master/en/setup/vscode.html
After opening the Firmware folder in vsc, I installed all recommended extensions. Then I selected the kit and clicked on build using the blue bar in the bottom to configure the project. Right after that, I got this error:
Bad CMake executable "". Is it installed or settings contain the correct path (cmake.cmakePath)?
What might be causing the problem? I am a beginner so if anything is unclear about the question please ask me for it. Thanks for all the help.

There is an issue with the path having a space in it apparently. Lots of people have run into this, but it has yet to be fixed (I just hit it myself earlier today). The "solution" (read: workaround...because Microsoft... 🙄) is to reinstall Cmake in a different directory (one with no spaces, obviously 😉), and to ensure that it is in your system path.
See this Github issue for extensive troubleshooting/discussion.

I had the same problem when I updated VSCode. In the project setting I put the full path of Cmake like:
"cmake.cmakePath": "/usr/local/bin/cmake"
And it worked.

I had the same problem and could solve it by (re)installing cmake:
sudo apt install cmake

If gcc is not installed, you need to install gcc first and then install cmake.
install gcc
sudo apt install build-essential
Download CMake from https://cmake.org/download/
Install CMake
$ ./bootstrap
$ make
$ make install
After this step try again and it should work.

Related

~/AppData/Local/nvim/init.vim doesn't exist

I am trying to install a config for Neovim and one of the installation steps requires that I install to ~/AppData/Local/nvim/init.vim. However, I don't see a nvim folder in /AppData/Local, only nvim-data. Anyone know why and how to fix? I installed Neovim with scoop by the way.

Recipe terminated with fatal error: spawn latexmk ENOENT

I have just installed debian 10 as well as vscode. I have been struggling with this for 3 days now.. I installed texlive from terminal with the following command:
sudo apt install texlive
I then installed the latex workshop extension in vscode and tried building a .tex file. The following error popped up:
Recipe terminated with fatal error: spawn latexmk ENOENT.
I then preceded to install latexmk from terminal with:
sudo apt install latexmk
The same error kept popping up after that. The output showed this.
[14:59:34] Recipe step env: {}
[14:59:34] cwd: /home/phoenix/Documents/stellies/year4/2021/s&s-414/pracs/prac-4/report
[14:59:34] LaTeX build process spawned. PID: undefined.
[14:59:35] LaTeX fatal error: spawn latexmk ENOENT, . PID: undefined.
[14:59:35] Does the executable exist? PATH: /app/bin:/usr/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/node/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/cargo/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/python/bin
[14:59:35] The environment variable $SHELL: /bin/sh
I then proceded to review the texlive website. I noticed that i did not set the path variable to include the texlive binaries. The texlive website gives the following path to the binary files : PATH=/usr/local/texlive/2021/bin/x86_64-linux:$PATH
however /usr/local/texlive does not exist on my system for some reason. Where can i find the correct path to the texlive binaries on Debian 10?
I had the same problem. The root cause was: (1) software's bin folder missing from PATH; (2) bad file privileges. Consequently, VSC couldn't access latexmk, which explains the error messages.
In my case, the problem occurred on a mac, and specifically after I installed MacTex, which, in turn, installs Tex Live. I believe the same solution may apply to linux distros too.
Solution:
Claim file ownership (which was originally root) under folder /usr/local/texlive: sudo chown -R <username> /usr/local/texlive, where <username> is the OS-level user name. The fix will work for this specific user. If it is not enough, try instead setting group owner appropriately, and/or consider Step 3.
Add /usr/local/texlive/2021/bin/<software_dialect> to PATH. <software_dialect> depends on the installed software version: in my case it is universal-darwin; on linux it might be x86_64-linux.
If the problem persists, try to change file access permissions under /usr/local/texlive using chmod.
EDIT: As a final step, restart VSC for changes to take effect.
I recently encountered the same problem on MacOS Monterrey (M1 based). I used basictex (just for the context). As required by the installation instruction,
I added TeXLive to PATH,
installed latexmk package to the TeX distribution.
However, still got the same error as OP.
Afte reading the wiki again more carefully, what finally worked for me was as simple as restarting VS Code and MacOS. Everything works as expected after a reboot of the MAC.
I had this same problem on Mac recently, the fix that worked for me was to uninstall and reinstall the LaTeX Workshop extension.
I got the same issue , seems to be a misbehaving from Vscode on MacOS
check if the command is in the path on mac
-which command_you are running example which latexmk
If this output something that means you have your latex installed, otherwise go and installed it and make sure it is accessible via command line.
If latex is installed and you are getting that issue you can just restart your VSCode and everything will be okay.
Had a similar error and came across this post when looking for a solution.
I wanted to use texlive on Vscode with WSL2 on Windows 10. Installing texlive-full in wsl fixed this error for me.
On Mac, this is a way to fix the issue
Step1: reinstall mactex by downloading it from this link: http://www.tug.org/mactex/mactex-download.html
Step2: In your terminal do cd /usr/local, you should see texlive folder
Step3: In your terminal do sudo vim etc/paths to set the environment. Details are in this link: https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/
Step4: In your terminal do /usr/local/texlive/2021/bin/x86_64-linux at the bottom. check the folder to see if the year is correct. Details in: http://www.tug.org/texlive/quickinstall.html.
Step5: Quit VC code completely, and reopen it.

Couldn't start client Rust Language Server

I'm trying to figure out how to use rustc & cargo from my WSL. I use VS Code and Rust (rls) plugin and can compile my code but there is a problem with RLS:
Couldn't start client Rust Language Server
Rustup not available. Install from https://www.rustup.rs/
How i can solve this problem?
Set rust-client.rustupPath in VSCode settings:
{
"rust-client.rustupPath": "~/.cargo/bin/rustup"
}
If you're using WSL on Windows then make sure you edit Rust extension WSL settings, not user/local settings.
Tutorial:
I had this problem as well with WSL and Visual Studio Code. The problem seems to stem from the fact that the Rust Language Server needs to find rustup in your path. We both probably followed the same path of using a package manager to install cargo, and therefore, the rust compiler tools. This does not include rustup which you can actually use to keep the rust toolchain up-to-date. rustup also appears to be the preferred method of installing the rust toolchain on your system.
After installing rustup with the default setup, you should see a .rustup directory in your home directory. This is where the toolchain lives. The install text all stated that it would add the toolchain to your environment path after logging out and back in, but I didn't have luck with this. I'm currently using fish instead of bash and had to update the configuration to include the toolchain at startup. Once I did that, I was able to have VSCode properly install and run the RLS.
This worked for me for in a remote SSH environment with Ubuntu 20.04
Edit .profile and .bashrc files in the user home directory
In .profile, comment the following line:
export PATH="$HOME/.cargo/bin:$PATH"
In both, add the following line:
[[ ":$PATH:" != *":$HOME/.cargo/bin:"* ]] && PATH="$HOME/.cargo/bin:${PATH}"
Reboot.
Even though if I run:
which rustup
/Users/justincalleja/.cargo/bin/rustup
A simple entry of rustup in the VSCode settings for:
"Rust-client: Rustup Path Path to rustup executable. Ignored if rustup
is disabled."
wasn't enough and I had to put the absolute path to the rustup binary as shown above. After doing so, I reloaded the window and was then asked to download missing components (or dependencies - the prompt is gone now I forgot). After doing this, the VSCode plugin seems to be working fine. I can format the code at least.
So it looks like it's some mismatch with VSCode's PATH and the PATH on my system. I'm not sure what it is but if you just want to get the extension to work, try using the absolute path to rustup in your Settings.
(Note: source "$HOME/.cargo/env" is added automatically to your startup files like .bashrc. First thing I tried was adding it to the startup file of zsh; the shell I'm using and to which it wasn't added. But that doesn't work either. I'm using rustc 1.49.0 (e1884a8e3 2020-12-29) ).
So... I'm running Rust on Windows 10 and I experienced this same issue. My Rust version is 1.24.3, my VSCode version is 1.63.2.
The first thing you need to do is add "%USERPROFILE%.cargo\bin" to your environment variables
The next solution that worked for me can be found in this tutorial: Rust on Windows and Visual Studio Code
i am running VSCode on mac, and using remote development.the remote server is
ubuntu 20. i had this problem, added rust-client.rustupPath to vscode settings and killed the vscode-server on remote server to fix this problem. now it work.

Version mismatch between tsc compiler and VS Code's language service

I just started playing with Visual Studio Code and when I created a new file called index.html, I am shown this warning message
A version mismatch between the globally installed tsc compiler (1.0.3.0) and VS Code's language service (1.8.10) has
Can someone please guide me what i have to do to fix this.
Is this serious or I can ignore. I googled but could not get much info
Thanks
I added this to my settings.json file, accessed through preferences > Workspace Settings :
"typescript.tsdk": "node_modules/typescript/lib"
now I no longer receive this error and in the bottom right corner of my screen it shows the current version of Typescript that I have installed.
[UPDATE] VS Code 1.6 now ships with TypeScript 2.0.3.
I just installed the latest Typescript, currently v.2.0.3, and installed VS Code v.1.5.3 on macOS Sierra. For some reason, exactly following the official doc didn't work for me.
Here's how I made it work:
After having installed the latest version globally:
npm i -g typescript, I added the following line to my settings.json file (opened by cmd + ,):
"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib",
Hope this helps someone else.
[update] as #ptpaterson mentioned on the comment below, on Windows the path is: "typescript.tsdk": "C:/Users/{user_name}/AppData/Roaming/npm/node_modules/typescript/lib/"
You have to change the version of TypeScript that Visual Code is using to match the version you have installed:
https://code.visualstudio.com/docs/languages/typescript#_using-newer-typescript-versions
The above is taken from the link:
If you want to use a newer version of TypeScript, you can define the typescript.tsdk setting (File > Preferences > User/Workspace Settings) pointing to a directory containing the TypeScript tsserver.js file.
You can find the installation location using npm list typescript, tsserver.js is usually under the lib folder.
For example:
{
"typescript.tsdk": "node_modules/typescript/lib"
}
You have to update your Typescript installation and restart Code afterwards:
npm install -g typescript
or
npm install -g typescript#1.8.10
The message should not longer appear, if it worked.
This error was being generated because I had a reference to an older installation of TypeScript in my System Path variable:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
The Visual Studio Code error was resolved when I removed this entry.
However, my TypeScript files then failed to transpile as the build action couldn't find the tsc.exe file.
When the SDK is installed (through Visual Studio or via a manual *.visx install), a tsc.exe file is installed and the PATH environment variable is updated to reference the folder that this file resides in (see above).
There is another way to transpile your files on a Windows environment by using node.js:
Install node.js. Installation packages can be found here.
Use npm to install TypeScript:
npm install -g typescript
This will add the TypeScript files to your profile AppData folder:
C:\Users\{your_user_name}\AppData\Roaming\npm\node_modules\typescript\lib
Configure your Visual Studio Code user settings.json file to reference this folder:
{
"typescript.tsdk": "C:\\Users\\{your_user_name}\\AppData\\Roaming\\npm\\node_modules\\typescript\\lib"
}
Add / update the user PATH environment variable to reference the folder that contains the tsc.cmd file:
%USERPROFILE%\AppData\Roaming\npm
None of the solutions above worked for me - first of all this is the global tsc I want to have updated to the latest version.
After I did some investigation it turned out that the problem lies in system's PATH variables; tsc.cmd (along with tscserver.cmd) exists in these locations:
c:\Program Files\nodejs - where the npm.exe and node.exe are
%USERPROFILE%\AppData\Roaming\npm - where global packages are
What you can do is to juggle environment\user variables so the tsc command would be resolved from %USERPROFILE% first instead of Program Files.
The quick & dirty way would be just deleting tsc.cmd and tscserver.cmd from the Program Files path.
Installing v2.0.3 of typescript was not sufficient... but but then updating the version dependency on package.json worked for me.
Npm command:
npm install -g typescript#2.0.3
Updated line on package.json:
"typescript": "^2.0.3"
The cause of my experience with this issue (in VSCode 1.8 on Mac OS X 10.12.2) was that I have been using NVM and while my code was running on the NVM version, VSCode was looking at a system installation of node.
Double check which installation of npm you are using to install typescript globally. If in doubt (on linux/mac) use which tsc from the command-line to verify the location being used by VSCode.
For example, if I simply call npm i -g typescript, npm resolves to ~/.nvm/versions/node/v6.9.1/bin/npm. I had to solve the problem by calling /usr/local/bin/npm i -g typescript explicitly because VSCode looks for node in /usr/local/bin/node by default.
Install TypeScript globally to share the installation across workspaces. In this case, you install it using npm install -g typescript#next.
You then have to tell VS Code on setting.json file (File -> Preferences -> Workspace Settings) the install location using the typescript.tsdk setting. Set typescript.tsdk to the path of the lib folder containing the tsserver.js file of the installed TypeScript module.
On windows:
"typescript.tsdk": "C:/Users/<MyUser>/AppData/Roaming/npm/node_modules/typescript/lib"
On Mac:
"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib"
Installing VSCode 1.6.0 fixed the TypeScript version mismatch warning message for me.
You'd think that this being a Microsoft product they'd give the Windows paths on their website
https://code.visualstudio.com/docs/languages/typescript#_using-newer-typescript-versions
but they don't. They only give the Unix path types.
Use:-
On windows: "typescript.tsdk": "C:/Users/YourNameHere/AppData/Roaming/npm/node_modules/typescript/lib/"
Note that forward strokes must be used even though Windows uses backstrokes for the paths!
Some other answers miss off the last forward stroke which is necessary.
You can just remove 'typescript.tsdk' and use the one embedded in Code if you don't really care about which tsdk version you use.

Step by step instructions for getting cppunit up and running with Netbeans 7.2 on OS X 10.8 Mountain Lion

Can someone please provide step by step instructions for getting cppunit working on OS X 10.8 Mountain Lion? This includes any downloads needed and any configuration of Netbeans.
Currently, when I add a cppunit test, there is a warning on the Add Test dialog that says "cppunit library is not detected. Test compilation might fail." I've download both from Sourceforge and from svn cppunit and copied the files to /usr/local/include, but this does not make compilation errors go away.
What am I missing? The Google™ has been of no help with this issue.
I used Homebrew to install CppUnit on OS X 10.8 Mountain Lion. Unit tests then worked from within Netbeans without issue.
The process I followed was:
Install the XCode Command Line Tools
Available in XCode preferences or Download as separate DMG
Install Homebrew
See Link
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
Following install instructions (brew doctor at the end for example)
Use brew to install cppunit
brew install cppunit
In Netbeans:
Create C++ project
Add a function to test
Right click cpp file, select "Create Test", choose CppUnit Test
Select function from list, follow prompts to create test
Execute tests
Right click project, select Test (or crtl+F6)
I finally figured out what I was doing wrong, so I thought I would answer my own question and avoid a Wisdom of the Ancients.
install Xcode.
install Xcode Command Line Tools via the Preferences dialog (Apple's documentation showing how to do this in Xcode 4)
download CPPUnit from Sourceforge
extract
Run ./configure
run make
run sudo make install
It's possible that the first time I tried this I didn't run the correct command for ./configurebut that's a dubious claim given the fact that I was able to tab complete i.e. I shouldn't have been able to run say ./config.
But I think the real key to my problem was having to call sudo on the make install. I was getting a permission error because the script needs admin rights to put the libraries where they need to go. I could have swore I tried this at some point and it too failed.
I had a coworker try this for me a month or so ago and he got it to work. I procrastinated retrying, but once I did, it worked like a charm. As far as I know, there's no bug between OS X 10.8.1 and 10.8.2 or .3.
Once I followed the steps I have listed above, I was able to go back to Netbeans and add a unit test without the dialog complaining. Furthermore, the test code compiled and ran.