How to solve CMAKE compiler error in CentOS machine ?
Hello,
I've developed a code in Qt IDE in windows and when I run it, it works well, however, when I passed to run the code in CentOS machine with CMAKE I got these error :
[azdoud@video-processor CentOSsimple]$ make Scanning dependencies of target main [100%] Building CXX object CMakeFiles/main.dir/main.cpp.o In file included from /usr/include/c++/4.8.2/thread:35:0, from /opt/working/CentOSsimple/main.cpp:5:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
/opt/working/CentOSsimple/main.cpp: In function ‘void loadVideo1(cv::VideoCapture, int, int)’:
/opt/working/CentOSsimple/main.cpp:24:65: error: ‘to_string’ was not declared in this scope
cv::putText(frame, "Frame "+to_string(frameNum+seek_step),
^
/opt/working/CentOSsimple/main.cpp: In function ‘int main()’:
/opt/working/CentOSsimple/main.cpp:92:10: error: ‘future1’ does not name a type
auto future1 = std::async(loadVideo, cap1,0,1);
^
/opt/working/CentOSsimple/main.cpp:93:10: error: ‘future2’ does not name a type
auto future2 = std::async(loadVideo, cap2,750,2);
^
/opt/working/CentOSsimple/main.cpp:94:10: error: ‘future3’ does not name a type
auto future3 = std::async(loadVideo, cap3,1000,3);
^
/opt/working/CentOSsimple/main.cpp:96:13: error: ‘future1’ was not declared in this scope
cout << future1.get() << endl;
^
/opt/working/CentOSsimple/main.cpp:97:13: error: ‘future2’ was not declared in this scope
cout << future2.get() << endl;
^
/opt/working/CentOSsimple/main.cpp:98:13: error: ‘future3’ was not declared in this scope
cout << future3.get() << endl;
^
make[2]: *** [CMakeFiles/main.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2
I've followed this documentation to set opencv and cmake in my machine, I've tested it, its works well too as you can see
[azdoud@video-processor CentOSsimple]$ make
Scanning dependencies of target main
[100%] Building CXX object CMakeFiles/main.dir/main.cpp.o
Linking CXX executable main
[100%] Built target main
[azdoud@video-processor CentOSsimple]$ ll
total 60
-rw-rw-r--. 1 azdoud azdoud 13171 Jun 8 11:40 CMakeCache.txt
drwxrwxr-x. 5 azdoud azdoud 4096 Jun 8 11:41 CMakeFiles
-rw-rw-r--. 1 azdoud azdoud 1585 Jun 8 11:40 cmake_install.cmake
-rw-rw-r--. 1 azdoud azdoud 166 Jun 8 11:39 CMakeLists.txt
-rwxrwxr-x. 1 azdoud azdoud 18912 Jun 8 11:41 main
-rw-rw-r--. 1 azdoud azdoud 435 Jun 8 11:02 main.cpp
-rw-rw-r--. 1 azdoud azdoud 4646 Jun 8 11:40 Makefile
[azdoud@video-processor CentOSsimple]$ ./main
Width : 37
Height: 69
This is the simple code that I'm trying to run in linux machine
#include <iostream> // for standard I/O
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2 ...
tnaksalot for the edit, no we can quote it easily ;)