Flutter Error: cmake error : debugging new project - flutter

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?

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

You can set the variables CMAKE_CXX_COMPILER, CMAKE_C_COMPILER in the linux/CMakeLists.txt before project() line
set ( CMAKE_CXX_COMPILER "pathto/g++" )
set ( CMAKE_C_COMPILER "/pathto/gcc" )
project(mytest)
source: CMAKE_C_COMPILER not set, after EnableLanguage

Related

Facing problem building flutter app. How to solve this issue?

How to identify which package is required and how can I solve this issue
I want to build my first flutter app in ubuntu 22.04LTS. And this problem is app isn't building:
CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:603 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal)
flutter/CMakeLists.txt:25 (pkg_check_modules)
i think you are missing this one. run this command and then flutter clean && flutter pub && flutter run
sudo apt install curl file git unzip xz-utils zip libglu1-mesa clang cmake \
ninja-build pkg-config libgtk-3-dev
if you still facing issue you have to folow these steps here to reinstall flutter on Ubuntu 20.04 |18.04 | 21.04 Linux

Command line tools not accessible from Eclipse on OSX

I am using Eclipse on a macOS machine. CMake is present on my machine at /usr/local/bin/cmake and has been installed using Homebrew. Eclipse is at the latest version (2018-09).
I have the following target in a Makefile, which has been set up and is visible from Eclipse:
all:
./configure
Rscript -e "Rcpp::compileAttributes()"
R CMD INSTALL --no-multiarch --with-keep.source .
Inside the configure file, there is this code:
cd src/build;cmake ..
However, when I double click the all target in Eclipse, I get the following message:
make all
./configure
./configure: line 1: cmake: command not found
make: *** [all] Error 127
I remember that some time ago this target worked out of the box on macOS. I can also launch CMake from a terminal without any trouble.
echo $PATH shows different behaviour:
If called from a standard macOS terminal, it yields /usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
If called from a TM Terminal inside Eclipse, it yields /usr/bin:/bin:/usr/sbin:/sbin
What is the most canonical way to have Eclipse detect my CMake installation ?
For macOS High Sierra 10.13.6, the solution provided here works. This must be performed to see the changes immediately.

setup: The program 'pg_config' is required but it could not be found

On nixos, when attempting to build my project with $ stack --nix build, I run into the following error.
$ stack --nix build
...
Linking /run/user/1000/stack25943/postgresql-libpq-0.9.2.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup ...
Configuring postgresql-libpq-0.9.2.0...
setup: The program 'pg_config' is required but it could not be found.
I have installed postgres following the nixos manual and do have pg_config installed, as shown by
$ which pg_config
/run/current-system/sw/bin/pg_config
It appears that stack does not know this location of my pg_config.
How do I proceed to get $ stack --nix build to succeed?
You'll need to add Nix packages to the nix-shell environment that it's building Haskell packages in.
In stack.yaml:
nix:
packages: [postgresql]
If you're getting this on mac, run brew install postgres then stack build

how to build pixhawk application

I am new in building PIXHAWK application. I am following the Pixhawk Pilot Support Package (PSP) User Guide. But I receive an error in running make px4fmu-v2_default and finally I can't finish it.
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
couldn't find python module jinja2:
For debian systems I tried:
sudo apt-get install python-jinja2
or for all other OSs/debian:
pip install jinja2
(missing: PY_JINJA2)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:377 (FPHSAFAILURE_MESSAGE)
cmake/common/px4_base.cmake:622 (find_package_handle_standard_args)
CMakeLists.txt:293 (px4_find_python_module)
-- Configuring incomplete, errors occurred!
See also "C:/pixhawk_toolchain/Firmware/build_px4fmu-v2_default/CMakeFiles/CMakeOutput.log".
rm: cannot remove directory `/c/pixhawk_toolchain/Firmware/build_px4fmu-v2_default': Permission denied
make: *** [px4fmu-v2_default] Error 1
How can I solve this?
For Ubuntu it can be
sudo apt-get install python-dev
Can you please try:
pip install -U Jinja2

protractor cant find cli.js file

I just installed protractor and the default repo along with webdriver. Every time I run protractor I get this error
module.js:340
throw err;
^
Error: Cannot find module '/usr/local/lib/node_modules/protractor/lib/cli.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
Not sure how to fix this... any clues?
Try to use the following solution :
under Configuration , use this for javascript file = /usr/lib/node_modules/protractor/lib/cli.js
I faced similar issue , it got resolved . I am using WebStorm in linux environment .
Make sure you installed protractor on the global position , by using this command :
sudo npm install -g protractor
sudo webdriver-manager update
webdriver-manager start
Got stuck similarly ... this worked for me.
Make sure to have "node_modules" & "node_modules/.bin" in the project folder, you can generate them by
running "npm install protractor" on the project root folder and then get rid of it "protractor" folder by running "npm uninstall protractor".