CMake Error at android.toolchain.cmake:621 (message): - android-ndk

I am getting the error with android ndk even though i have set ndk to my path.
CMake Error at android.toolchain.cmake:621 (message):
Could not find any working toolchain in the NDK. Probably your Android NDK is broken.
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.5.1/share/cmake/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt:52 (project)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found. Stop.

Related

ERRO Linux Mint "Check for working C compiler: /usr/bin/cc "

i want to use virtual camera on linux with obs studio. i see this package https://github.com/CatxFish/obs-v4l2sink
i ran
sudo apt install qtbase5-dev
sudo apt install libobs-dev
git clone --recursive https://github.com/obsproject/obs-studio.git
git clone https://github.com/CatxFish/obs-v4l2sink.git cd obs-v4l2sink mkdir build && cd build cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
when i ran cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
i got error
`-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/arp/obs-v4l2sink/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_a18d3/fast && /usr/bin/make -f CMakeFiles/cmTC_a18d3.dir/build.make CMakeFiles/cmTC_a18d3.dir/build
make[1]: Entering directory '/home/arp/obs-v4l2sink/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a18d3.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_a18d3.dir/testCCompiler.c.o -c /home/arp/obs-v4l2sink/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_a18d3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a18d3.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_a18d3.dir/testCCompiler.c.o -o cmTC_a18d3
/usr/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_a18d3.dir/build.make:87: cmTC_a18d3] Error 1
make[1]: Leaving directory '/home/arp/obs-v4l2sink/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_a18d3/fast] Error 2
CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)
CMake Error at CMakeLists.txt:2 (project): No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred! See also "/home/arp/obs-v4l2sink/build/CMakeFiles/CMakeOutput.log". See also "/home/arp/obs-v4l2sink/build/CMakeFiles/CMakeError.log".
i have seen some articles. but nothing changes.
anyone can help me?

Unable to build VTK examples

I'm having lots of difficulties just building VTK examples - can someone help please?
I've downloaded and installed VTK-9.0.1 on my ubuntu 18.04.4 system. Now I want to install and run the VTK examples at this link., so I clone that repo. Then I follow the instructions to "Build all of the examples" at this link.. So I do this:
% mkdir VTKExamples-build
% cd VTKExamples-build
% cmake ../VTKExamples
cmake outputs these messages:
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- VTKWikiExamples: Building VTKWikiExamples stand-alone
-- VTKWikiExamples: Building VTKWikiExamples stand-alone - yes
-- VTKWikiExamples: Setting executables prefix
-- VTKWikiExamples: Setting executables prefix - no
-- VTKWikiExamples: VTK VERSION: 9.0.1(OpenGL2)
-- VTKWikiExamples: Example executables are stored in /home/oreilly/VTKExamples-build/bin
-- VTKWikiExamples: Tests will not be built
CMake Warning (dev) at /usr/local/lib/cmake/vtk-9.0/vtkModule.cmake:2847 (message):
No `MODULES` passed to `vtk_modules_autoinit`.
Call Stack (most recent call first):
src/Cxx/DataStructures/CMakeLists.txt:48 (vtk_module_autoinit)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/lib/cmake/vtk-9.0/vtkModule.cmake:2847 (message):
No `MODULES` passed to `vtk_modules_autoinit`.
src/Cxx/DataStructures/CMakeLists.txt:48 (vtk_module_autoinit)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/lib/cmake/vtk-9.0/vtkModule.cmake:2847 (message):
No `MODULES` passed to `vtk_modules_autoinit`.
Call Stack (most recent call first):
src/Cxx/DataStructures/CMakeLists.txt:48 (vtk_module_autoinit)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/lib/cmake/vtk-9.0/vtkModule.cmake:2847 (message):
No `MODULES` passed to `vtk_modules_autoinit`.
Call Stack (most recent call first):
src/Cxx/DataStructures/CMakeLists.txt:48 (vtk_module_autoinit)
This warning is for project developers. Use -Wno-dev to suppress it.
The "No MODULES passed to vtk_modules_autoinit" error message is repeated over 400 times, and no Makefile is generated.
What am I doing wrong???
Thanks!

Cross-Compile for Raspberry pi opencv linking problems

(Sorry for bad English, I'm German)
Hello programmers,
I'm desperately trying to cross compile a program (using OpenCV) on my linux(fedora) x86_x64 laptop for a linux(raspian) Raspberry pi 3.
I'm following this tutorial (https://solderspot.wordpress.com/2016/02/04/cross-compiling-for-raspberry-pi-part-ii/) and a simple std::cout << "test\n"; program compiles and works fine with the following CMakeLists.txt:
cmake_minimum_required (VERSION 2.8)
project (CVS)
find_package(OpenCV REQUIRED)
SET(COMPILE_DEFINITIONS -Werror)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_definitions(-DHOST_ROBO_DIR=/home/username/Dropbox/Roboter)
include_directories(SYSTEM ${PIROOT}/opt/vc/include ${PIROOT}/opt/vc/include/interface/vcos/pthreads ${PIROOT}/opt/vc/include/interface/vmcs_host/linux )
link_directories( ${PIROOT}/opt/vc/lib )
add_executable (CVS ../source/main.cpp)
The Problem comes with OpenCV...
If I use the CMakeLists.txt from above it generates (for obvious reasons) many "undefined reference" errors eg.: "undefined reference to `cv::waitKey(int)'"
If I add "target_link_libraries( CVS ${OpenCV_LIBS} )" or "target_link_libraries(CVS -lopencv_core)" to the CMakeLists.txt make produces the following error:
/home/username/pidev/piroot/usr/local/lib/libopencv_core.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)#GLIBCXX_3.4.20'
If I replace "SET(TOOLROOT ${PITOOLS}/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64)" in ~/pidev/pi-toolchain.cmake with "SET(TOOLROOT ${PITOOLS}/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf)" I got the following error:
[username#MSI-Linux msi]$ cmake -DCMAKE_TOOLCHAIN_FILE=~/pidev/pi-toolchain.cmake .
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /home/username/pidev/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /home/username/pidev/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -- broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
"/home/username/pidev/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/username/Dropbox/Roboter/raspySync/CVS/cvs5-6/msi/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_b1abe/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_b1abe.dir/build.make
CMakeFiles/cmTC_b1abe.dir/build
gmake[1]: Verzeichnis
„/home/username/Dropbox/Roboter/raspySync/CVS/cvs5-6/msi/CMakeFiles/CMakeTmp“
wird betreten
Building C object CMakeFiles/cmTC_b1abe.dir/testCCompiler.c.o
/home/username/pidev/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
--sysroot=/home/username/pidev/piroot
-Wl,-rpath-link,/home/username/pidev/piroot/opt/vc/lib
-Wl,-rpath-link,/home/username/pidev/piroot/lib/arm-linux-gnueabihf
-Wl,-rpath-link,/home/username/pidev/piroot/usr/lib/arm-linux-gnueabihf
-Wl,-rpath-link,/home/username/pidev/piroot/usr/local/lib -o
CMakeFiles/cmTC_b1abe.dir/testCCompiler.c.o -c
/home/username/Dropbox/Roboter/raspySync/CVS/cvs5-6/msi/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_b1abe
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b1abe.dir/link.txt
--verbose=1
/home/username/pidev/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
--sysroot=/home/username/pidev/piroot
-Wl,-rpath-link,/home/username/pidev/piroot/opt/vc/lib
-Wl,-rpath-link,/home/username/pidev/piroot/lib/arm-linux-gnueabihf
-Wl,-rpath-link,/home/username/pidev/piroot/usr/lib/arm-linux-gnueabihf
-Wl,-rpath-link,/home/username/pidev/piroot/usr/local/lib
CMakeFiles/cmTC_b1abe.dir/testCCompiler.c.o -o cmTC_b1abe -rdynamic
/home/username/pidev/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld:
cannot find crt1.o: No such file or directory
/home/username/pidev/pitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld:
cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_b1abe.dir/build.make:97: die Regel für Ziel
„cmTC_b1abe“ scheiterte
gmake[1]: *** [cmTC_b1abe] Fehler 1
gmake[1]: Verzeichnis
„/home/username/Dropbox/Roboter/raspySync/CVS/cvs5-6/msi/CMakeFiles/CMakeTmp“
wird verlassen
Makefile:126: die Regel für Ziel „cmTC_b1abe/fast“ scheiterte
gmake: *** [cmTC_b1abe/fast] Fehler 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/home/username/Dropbox/Roboter/raspySync/CVS/cvs5-6/msi/CMakeFiles/CMakeOutput.log".
See also "/home/username/Dropbox/Roboter/raspySync/CVS/cvs5-6/msi/CMakeFiles/CMakeError.log".
[username#MSI-Linux msi]$
I would be thankful if anyone could answer one of these questions:
- How can I cross-compile a program that uses OpenCV commands
- Why is there an "undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)#GLIBCXX_3.4.20'" and a "The C compiler ... is not able to compile a simple test program."
- Would it be bad or REALLY bad style if I add a something like this in the program:
namespace std
{
void __throw_out_of_range_fmt(char const*, ...)
{
std::cout << "throw out of range error\n";
}
}
Heres my ~/pidev/pi-toolchain.cmake:
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(DEVROOT $ENV{HOME}/pidev)
SET(PIROOT ${DEVROOT}/piroot)
SET(PITOOLS ${DEVROOT}/pitools)
SET(TOOLROOT ${PITOOLS}/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64)
# specify the cross compiler
SET(CMAKE_C_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLROOT}/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_SYSROOT ${PIROOT})
SET(CMAKE_FIND_ROOT_PATH ${PIROOT})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(FLAGS "-Wl,-rpath-link,${PIROOT}/opt/vc/lib -Wl,-rpath-link,${PIROOT}/lib/arm-linux-gnueabihf -Wl,-rpath-link,${PIROOT}/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,${PIROOT}/usr/local/lib")
UNSET(CMAKE_C_FLAGS CACHE)
UNSET(CMAKE_CXX_FLAGS CACHE)
SET(CMAKE_CXX_FLAGS ${FLAGS} CACHE STRING "" FORCE)
SET(CMAKE_C_FLAGS ${FLAGS} CACHE STRING "" FORCE)
The "cannot find crt1.o: No such file or directory"-error is a known problem with the "arm-rpi-4.9.3-linux-gnueabihf"-toolchain, see 4.9 toolchain issue #50.
The "`std::__throw_out_of_range_fmt(char const*, ...)#GLIBCXX_3.4.20'"-error is related to gcc 4.8, see std::__throw_out_of_range_fmt(char const*, …)#GLIBCXX_3.4.20'. I'm not quite sure why this happens to you, since I was able to build opencv with the "gcc-linaro-arm-linux-gnueabihf-raspbian-x64"-toolchain.
Maybe you have some luck with the way I did it: How do I cross compile OpenCV for the Raspberry Pi with additional modules (highgui…)
Example CMakeLists.txt
project(Test)
cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_STANDARD 11)
aux_source_directory(. SRC_LIST)
find_package(OpenCV REQUIRED)
add_executable(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
Invoke cmake like this:
cmake -D CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE -D PIROOT=$MOUNT_DIR -D TOOLROOT=$TOOLCHAIN ..

Libhand library compilation error cannot find -lNOTFOUND

I'm trying to build a hand model library from libhand.org on Ubuntu 14.04. The library uses ogre and opencv libraries. I followed the instructions provided by the author that allowed me to successfully install ogre and opencv. There is no problem with cmake .. . but during execute command
make -j4
I get the following error:
[ 87%] Building CXX object source/CMakeFiles/hand_renderer.dir/hand_pose.cc.o
[ 91%] Building CXX object source/CMakeFiles/hand_renderer.dir/scene_spec.cc.o
Linking CXX static library libhand_renderer.a
[ 91%] Built target hand_renderer
Scanning dependencies of target pose_designer
[ 95%] Building CXX object source/CMakeFiles/pose_designer.dir/pose_designer_main.cc.o
[100%] Building CXX object source/CMakeFiles/pose_designer.dir/pose_designer.cc.o
Linking CXX executable pose_designer
/usr/bin/ld: cannot find -lNOTFOUND
/usr/bin/ld: cannot find -lNOTFOUND
libhand_utils.a(file_dialog.cc.o): In function
`libhand::FileDialog::TkExec(std::string const&)':
file_dialog.cc:(.text+0xead): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
collect2: error: ld returned 1 exit status
make[2]: *** [source/pose_designer] Error 1
make[1]: *** [source/CMakeFiles/pose_designer.dir/all] Error 2
make: *** [all] Error 2
Does anyone know why this error occurs and what can be done?
I assume this error occurs because some required library was not found during the run of cmake but that incident was not correctly detected (ie. cmake did not abort with an error). More details on that should be available in a file named CMakeError.log or CMakeOutput.log in the CMakeFiles directory.
The solution to this problem is either installing the missing library (which name should be available from the aforementioned files) or fix the build process to find the library, if it is already installed (for autotools, this would be using the CFLAGS and LDFLAGS environment variables to point to the correct include paths, compiler options, library paths and libraries; that should also work with CMake).
As an alternative explanation, cmake found the library but somehow failed to write the correct Makefiles. Then the solution would be manually replacing -lNOTFOUND by -l<library name> in the Makefiles.

cmake in cygwin: cyglto_plugin.dll not found

I am trying to get a Fortran 90 program to compile under Windows. I have already successfully done so under Linux.
I am using the 'Babun' windows shell, which is basically a wrapper for cygwin: https://github.com/babun/babun
When I try and run cmake, I get the following:
-- The Fortran compiler identification is GNU
-- Check for working Fortran compiler: /usr/bin/gfortran.exe
-- Check for working Fortran compiler: /usr/bin/gfortran.exe -- broken
CMake Error at /usr/share/cmake-2.8.9/Modules/CMakeTestFortranCompiler.cmake:40 (MESSAGE):
The Fortran compiler "/usr/bin/gfortran.exe" is not able to compile a
simple test program.
It fails with the following output:
Change Dir: /cygdrive/d/Users/bob/code/vasa/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make.exe "cmTryCompileExec674739544/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec674739544.dir/build.make
CMakeFiles/cmTryCompileExec674739544.dir/build
make[1]: Entering directory
'/cygdrive/d/Users/bob/code/vasa/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake.exe -E cmake_progress_report
/cygdrive/d/Users/bob/code/vasa/build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building Fortran object
CMakeFiles/cmTryCompileExec674739544.dir/testFortranCompiler.f.o
/usr/bin/gfortran.exe -c
/cygdrive/d/Users/bob/code/vasa/build/CMakeFiles/CMakeTmp/testFortranCompiler.f
-o CMakeFiles/cmTryCompileExec674739544.dir/testFortranCompiler.f.o
Linking Fortran executable cmTryCompileExec674739544.exe
/usr/bin/cmake.exe -E cmake_link_script
CMakeFiles/cmTryCompileExec674739544.dir/link.txt --verbose=1
/usr/bin/gfortran.exe -Wl,--enable-auto-import
CMakeFiles/cmTryCompileExec674739544.dir/testFortranCompiler.f.o -o
cmTryCompileExec674739544.exe
-Wl,--out-implib,libcmTryCompileExec674739544.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
gfortran: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
CMakeFiles/cmTryCompileExec674739544.dir/build.make:83: recipe for target
'cmTryCompileExec674739544.exe' failed
make[1]: *** [cmTryCompileExec674739544.exe] Error 1
make[1]: Leaving directory
'/cygdrive/d/Users/bob/code/vasa/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec674739544/fast' failed
make: *** [cmTryCompileExec674739544/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:9 (enable_language)
What package does this cyglto_plugin.dll belong to? What dependencies am I missing?
Thanks!

Resources