Build configuration: cannot execute an Qt's example in MS Studio Code
-
wrote on 4 Oct 2024, 20:18 last edited by ArantxaES 10 Apr 2024, 20:22
Hi everybody,
How do you configure the Build (Qt + CMake) in your beloved IDE's (MSVC) Workspace?
This tutorial on the internet didn't help me, because I'm using an OS different from Windows OS.
So here are the hard facts:- OS: Ubuntu 24.0.1 (brand-new!)
- Qt: Creator 6.7.3
- Compiler: gcc/g++ 13.2
- IDE: MS Visual Studio Code (from snap)
- Extensions installed in MVSC: ms-vscode.cpptools, twxs.cmake, ms-vscode.cmake-tools, theqtcompany.qt, theqtcompany.qt-cpp-pack and tonka3000.qtvsctools
- Qt's installation folder: home/Qt/
- Qt example's folder: home/Qt/Examples/Qt-6.7.3/widgets/widgets/calculator/
How I defined my workspace
I defined as Workspace the Qt's installation folder altogether with the Qt's example folder, just to be sure that the header and source files would be also considered.
MSVC automatically created a "blended configuration folder" called ".vscode". There are under "calculator" Folder, for example, two JSON-Files: "c_cpp_properties.json" and "tasks.json". Under "Qt" folder just one: "settings.json".What happens when I open the calculator.cpp file
There is these notification:
Bad CMake executable: "". Check to make sure it is installed or the value of the "cmake.cmakePath" setting contains the correct pathHow are the MSVC Settings*
At "MSVC Settings -> Extensions -> CMake Tools -> Cmake Path" is setted as "cmake".
In my Linux Terminal I got this information:whereis cmake cmake: /usr/share/cmake
And what's in inside:
/usr/share/cmake/bash-completion$ ls bash-completion-config.cmake bash-completion-config-version.cmake
But when I change it on "MSVC Settings -> Extensions -> CMake Tools -> Cmake Path"* I get the real-time notification:
Executing command: /usr/share/cmake --version
[proc] The command: /usr/share/cmake --version failed with error: Error: spawn /usr/share/cmake EACCES/ENOENTThen I installed by snap the CMake, but that's totally confusing... shouldn't the MSVC's Extension for CMakeTools make it easier? My stand-alone Qt Creator worked, but I'm guessing that they used qmake instead of cmake.
So I left the field as: /snap/bin/cmake
But the notification is still the same! :(
-
Hi everybody,
How do you configure the Build (Qt + CMake) in your beloved IDE's (MSVC) Workspace?
This tutorial on the internet didn't help me, because I'm using an OS different from Windows OS.
So here are the hard facts:- OS: Ubuntu 24.0.1 (brand-new!)
- Qt: Creator 6.7.3
- Compiler: gcc/g++ 13.2
- IDE: MS Visual Studio Code (from snap)
- Extensions installed in MVSC: ms-vscode.cpptools, twxs.cmake, ms-vscode.cmake-tools, theqtcompany.qt, theqtcompany.qt-cpp-pack and tonka3000.qtvsctools
- Qt's installation folder: home/Qt/
- Qt example's folder: home/Qt/Examples/Qt-6.7.3/widgets/widgets/calculator/
How I defined my workspace
I defined as Workspace the Qt's installation folder altogether with the Qt's example folder, just to be sure that the header and source files would be also considered.
MSVC automatically created a "blended configuration folder" called ".vscode". There are under "calculator" Folder, for example, two JSON-Files: "c_cpp_properties.json" and "tasks.json". Under "Qt" folder just one: "settings.json".What happens when I open the calculator.cpp file
There is these notification:
Bad CMake executable: "". Check to make sure it is installed or the value of the "cmake.cmakePath" setting contains the correct pathHow are the MSVC Settings*
At "MSVC Settings -> Extensions -> CMake Tools -> Cmake Path" is setted as "cmake".
In my Linux Terminal I got this information:whereis cmake cmake: /usr/share/cmake
And what's in inside:
/usr/share/cmake/bash-completion$ ls bash-completion-config.cmake bash-completion-config-version.cmake
But when I change it on "MSVC Settings -> Extensions -> CMake Tools -> Cmake Path"* I get the real-time notification:
Executing command: /usr/share/cmake --version
[proc] The command: /usr/share/cmake --version failed with error: Error: spawn /usr/share/cmake EACCES/ENOENTThen I installed by snap the CMake, but that's totally confusing... shouldn't the MSVC's Extension for CMakeTools make it easier? My stand-alone Qt Creator worked, but I'm guessing that they used qmake instead of cmake.
So I left the field as: /snap/bin/cmake
But the notification is still the same! :(
@ArantxaES said in Build configuration: cannot execute an Qt's example in MS Studio Code:
whereis cmake
cmake: /usr/share/cmakeI don't know what/why
whereis
is looking for a directory but you must point it to the cmake executable, most likely in /usr/bin/ (or you forgot to install it). -
wrote on 4 Oct 2024, 20:31 last edited by ArantxaES 10 Apr 2024, 20:37
Hallo Christian,
The error remains after some trials:
/snap/bin/cmake
/snap/bin/
/snap/binarantxa@ARANTXA-R2D2:~$ /snap/bin/cmake --version cmake version 3.30.4
-
wrote on 5 Oct 2024, 14:14 last edited by
I was able to resolve replacing "/snap/bin/cmake" for:
cmake.cmakePath = /snap/cmake/current/bin/cmake -
1/4