Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Error: cmake error : debugging new project

I just start a new flutter project in vscode , when I want debugging the project , I got Error:

  Could not find compiler set in environment variable CXX:

  clang++.

Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Exception: Unable to generate build files

I search on internet , and I found my "cmake" package , doesn't have g++.exe , so install it manually by following command line:

sudo apt-get install g++

but it doesn't work , how can I solve it?

like image 898
irmoah80 Avatar asked Mar 24 '26 20:03

irmoah80


2 Answers

I found the solution:

1- first run this command line :

sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev

2- run flutter clean , but you must run it from your project root , done!

source : here

like image 159
irmoah80 Avatar answered Mar 27 '26 11:03

irmoah80


I run this command on my Ubuntu 22.04 and it worked for me : sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev clang cmake ninja-build pkg-config libgtk-3-dev libboost-all-dev libsecret-1-dev libjsoncpp-dev libsecret-1-0

like image 43
MD. Ismail Hosen James Avatar answered Mar 27 '26 10:03

MD. Ismail Hosen James



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!