Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command 'cmake.build' not found #157

Closed
jayphelps opened this issue Jun 2, 2017 · 14 comments
Closed

command 'cmake.build' not found #157

jayphelps opened this issue Jun 2, 2017 · 14 comments
Labels
bug a bug in the product
Milestone

Comments

@jayphelps
Copy link

jayphelps commented Jun 2, 2017

With a fresh install of vscode + cmaketools, if I try to run any of the commands I just get an error that the command is not found. e.g. command 'cmake.build' not found. None of the options show up in the toolbar, as well. Tried in 6 different cmake based projects I have on my box, same results.

Someone else posted the same issue on SO: https://stackoverflow.com/questions/44122346/vs-code-cmake-cmake-build-not-found but since it hasn't (yet) received a response I figured I'd cross post it here for more eyes. If you know the answer, you could add it to the SO question and then we can copy/link the answer here. 🎈

It's possible probable that we're just missing something obvious. If that's the case, happy to update the README so others don't make it too.

(from README)

PLEASE, if you experience any problems, have any questions, or have an idea for a new feature, create an issue


EDIT:

Solution

there's a bug preventing a dependency from being installed. You need to install this additional extension https://marketplace.visualstudio.com/items?itemName=twxs.cmake

@wtianyi
Copy link

wtianyi commented Jun 3, 2017

Did you install the extension twxs.cmake? It's a required dependency but was not installed when I installed cmaketools. Installing that solves my similar problem.

@vector-of-bool
Copy link
Contributor

@jayphelps, as @wtianyi said, does installing the twxs.cmake extension help?

I have it listed in package.json as an extension dependency, and I thought that VSCode would use that to automatically install other extensions, but apparently not.

@vector-of-bool vector-of-bool added the bug a bug in the product label Jun 4, 2017
@vector-of-bool vector-of-bool added this to the 0.10.0 milestone Jun 4, 2017
@jayphelps
Copy link
Author

jayphelps commented Jun 5, 2017

Yes, installing twxs.cmake (also known as just "CMake" in the marketplace) solved it for me. Here's a direct link to the correct one for anyone looking: https://marketplace.visualstudio.com/items?itemName=twxs.cmake

Feel free to close when you believe you've solved the issue preventing it from being installed automatically.

Thanks for your help!

@kriegalex
Copy link

I do have the same problem as @jayphelps but I already had Cmake (from twxs) installed

@papahabla
Copy link

I needed to uninstall both CMake, and CMake Tools extensions. After re-installing them, everything worked again.

@vector-of-bool
Copy link
Contributor

@kriegalex, are you still seeing this problem? Did this first start after the 0.9.5 update?

@benkonz
Copy link

benkonz commented Jun 6, 2017

@vector-of-bool I just started getting this issue today also.

@vector-of-bool
Copy link
Contributor

The same error appears in issue #163, but it may be a different issue. Check over there if the listed solution above doesn't work for you.

@kriegalex
Copy link

kriegalex commented Jun 6, 2017

I just tried to uninstall, restart and reinstall, still having this problem. I don't know when it started because I have this problem since day one, but I only tried VS Code + CMake recently. I am working with Visual Studio 2015 and CMake 3.8 aside, that's why I didn't really go further.

This is the output of the Developer Tools :

[Extension Host] Error setting up client: AssertionError: Unknown cache entry type: undefined
    at Console.assert (console.js:95:23)
    at Function.parseCache (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\cache.js:116:29)
    at Function.<anonymous> (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\cache.js:65:50)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\cache.js:4:58)
[Extension Host] Error during CMake Tools initialization! TypeError: Cannot read property 'getGlobalSettings' of undefined
    at ServerClientCMakeTools.<anonymous> (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\client.js:328:44)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\client.js:4:58)

The second error can be removed by disabling CMake server (cmake.useCMakeServer=false).

@benkonz
Copy link

benkonz commented Jun 6, 2017

@vector-of-bool I set cmake.useCmakeServer to false just like the fix in #163 and it worked, thanks.

@jessehao
Copy link

jessehao commented Jun 7, 2017

I had the same problem. few days ago, I installed this extension on my PC and everything worked well. but yesterday, I installed it to my Laptop(Windows), the problem occured. and I tried everything like uninstall them and reinstall them one by one. but it's not working.
Everything sets just like my PC's except the result.

if i turn cmake.useCMakeServer to false. it'll working, but it build project to "vscproject" instead of "MinGW Makefiles".

@jessehao
Copy link

jessehao commented Jun 7, 2017

OK guys, problem solved!
Platform: Windows + MinGW
Solution:

  1. create a new copy of "mingw32-make.exe".
  2. rename the copy to "make.exe".
  3. restart your vscode.

@ytimenkov
Copy link
Contributor

I just checked: since vector-of-bool.cmake-tools depends on twxs.cmake extension, VS code automatically install the latter and doesn't allow to disable or uninstall it separately.
At least version 1.12 I'm using.

@vector-of-bool
Copy link
Contributor

So, I've just pushed 0.9.7:

  1. No more dependency on twxs.cmake, so that shouldn't be causing any issues anymore
  2. @ytimenkov fixed some version parsing code that was lying about what version of CMake was installed. Should fix issues people are seeing with pre-3.7 versions.
  3. @ytimenkov added better errors when initialization failed. This should help create future tickets!

As such, I'm going to close this issue and ask that anyone with any further issues open a new ticket using the new error messages that appear during a failed initialization.

Thanks for the help, everyone!

@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug a bug in the product
Projects
None yet
Development

No branches or pull requests

8 participants