building opencv 2.4.6 on Mac - Mavericks - c++

I downloaded opencv 2.4.6 for mac OSX (Mavericks). Untared the tar file and made the following steps:
cd opencv-2.4.6.1/
mkdir build
cd build/
cmake -G "Unix Makefiles" ..
make -j8
But I get an error on the build
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/core/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/imgproc/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(core)
^~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
CV_PERF_TEST_MAIN(imgproc)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/highgui/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(highgui)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
1 error generated.
1 error generated.
make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [modules/highgui/CMakeFiles/opencv_perf_highgui.dir/perf/perf_main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [modules/imgproc/CMakeFiles/opencv_perf_imgproc.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/imgproc/CMakeFiles/opencv_perf_imgproc.dir/all] Error 2
[ 50%] [ 50%] [ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_perf_highgui.dir/perf/perf_precomp.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_fast.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_descriptors_regression.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_detectors_regression.cpp.o
[ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_ffmpeg.cpp.o
[ 50%] Building CXX object modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_main.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o
make[1]: *** [modules/highgui/CMakeFiles/opencv_perf_highgui.dir/all] Error 2
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_fast.cpp.o
[ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_fourcc.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_orb.cpp.o
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/calib3d/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(calib3d)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_keypoints.cpp.o
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/features2d/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(features2d)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
1 error generated.
make[2]: *** [modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/all] Error 2
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_precomp.cpp.o
1 error generated.
make[2]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_framecount.cpp.o
[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_main.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_grfmt.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_gui.cpp.o
[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_matchers_algorithmic.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_main.cpp.o
[ 51%] [ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_positioning.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_mser.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_precomp.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_video_io.cpp.o
make[1]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/all] Error 2
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_nearestneighbors.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_video_pos.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_orb.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_precomp.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_rotation_and_scale_invariance.cpp.o
Linking CXX executable ../../bin/opencv_test_highgui
[ 52%] Built target opencv_test_highgui
Linking CXX executable ../../bin/opencv_test_features2d
[ 52%] Built target opencv_test_features2d
make: *** [all] Error 2

I used this compilation options for cmake:
cmake -G "Unix Makefiles" -D CMAKE_INSTALL_PREFIX=/Users/produit/Library/Developer/opencv/ -D CMAKE_OSX_ARCHITECTURES=x86_64 -D BUILD_PERF_TESTS=OFF -D BUILD_opencv_legacy=NO ..

It's strange, the bug hase already been reported! http://code.opencv.org/issues/3179
And have already been solved:
https://github.com/Itseez/opencv/pull/1244
Still - for a quick solution:
Open up the
[...]opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp
Edit around line 480:
with the following:
#if defined(_MSC_VER) && (_MSC_VER <= 1400)
#define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...) \
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/
#else
#define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...) \
__VA_ARGS__;
#endif
#define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...) \
CV_PERF_TEST_MAIN_INTERNALS_ARGS(__VA_ARGS__) \'
instead of:
#define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...) \
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\
Its more or less this change on git:
https://github.com/vkocheganov/opencv/commit/e4b201be25ff92e930b979098e94a89368677313
Worked for me :-)

Related

CGAL namespace does not contain data_file_path function

I am using xubuntu20.04 and trying out to compile an example of cgal. for reference, I am working with AABB_tree. CGAL is header only so I copied the include folder to AABB_tree directory. Followed this instruction. when I run make this error is generated-
Scanning dependencies of target AABB_segment_3_example
[ 3%] Building CXX object CMakeFiles/AABB_segment_3_example.dir/AABB_segment_3_example.cpp.o
[ 7%] Linking CXX executable AABB_segment_3_example
[ 7%] Built target AABB_segment_3_example
Scanning dependencies of target AABB_custom_indexed_triangle_set_array_example
[ 10%] Building CXX object CMakeFiles/AABB_custom_indexed_triangle_set_array_example.dir/AABB_custom_indexed_triangle_set_array_example.cpp.o
[ 14%] Linking CXX executable AABB_custom_indexed_triangle_set_array_example
[ 14%] Built target AABB_custom_indexed_triangle_set_array_example
Scanning dependencies of target AABB_polyhedron_facet_distance_example
[ 17%] Building CXX object CMakeFiles/AABB_polyhedron_facet_distance_example.dir/AABB_polyhedron_facet_distance_example.cpp.o
[ 21%] Linking CXX executable AABB_polyhedron_facet_distance_example
[ 21%] Built target AABB_polyhedron_facet_distance_example
Scanning dependencies of target AABB_halfedge_graph_edge_example
[ 25%] Building CXX object CMakeFiles/AABB_halfedge_graph_edge_example.dir/AABB_halfedge_graph_edge_example.cpp.o
[ 28%] Linking CXX executable AABB_halfedge_graph_edge_example
[ 28%] Built target AABB_halfedge_graph_edge_example
Scanning dependencies of target AABB_cached_bbox_example
[ 32%] Building CXX object CMakeFiles/AABB_cached_bbox_example.dir/AABB_cached_bbox_example.cpp.o
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp: In function ‘void triangle_mesh(std::string)’:
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp:30:17: error: ‘read_polygon_mesh’ is not a member of ‘CGAL::IO’
30 | if(!CGAL::IO::read_polygon_mesh(fname, tmesh) || CGAL::is_triangle_mesh(tmesh))
| ^~~~~~~~~~~~~~~~~
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp: In function ‘int main(int, char**)’:
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp:86:54: error: ‘data_file_path’ is not a member of ‘CGAL’
86 | triangle_mesh<Polyhedron_3>((argc>1)?argv[1]:CGAL::data_file_path("meshes/tetrahedron.off"));
| ^~~~~~~~~~~~~~
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp:89:54: error: ‘data_file_path’ is not a member of ‘CGAL’
89 | triangle_mesh<Surface_mesh>((argc>1)?argv[1]:CGAL::data_file_path("meshes/tetrahedron.off"));
| ^~~~~~~~~~~~~~
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp:92:50: error: ‘data_file_path’ is not a member of ‘CGAL’
92 | surface_mesh_cache_bbox((argc>1)?argv[1]:CGAL::data_file_path("meshes/tetrahedron.off"));
| ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/AABB_cached_bbox_example.dir/build.make:63: CMakeFiles/AABB_cached_bbox_example.dir/AABB_cached_bbox_example.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:266: CMakeFiles/AABB_cached_bbox_example.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
It looks like cgal namespace does not include a data_file_path function. How to fix the problem? Is there any linking problem exist?
I have copied the meshes/tetrahedron.off to the AABB_tree directory. Since the function does not exist, no way to read it.

CMake compile project with different GCC/G++

I have a project that compiles on Ubuntu with gcc and g++ 7.5. For some reason it does not compile with the latest G++ on my Arch.
For some reason, std::atomic_bool is not found, even though the exact same code compiles in Ubuntu.
I installed gcc and g++ 7.5 onto my Arch, and then ran the following as per here:
export CC=/usr/bin/gcc-7
export CXX=/usr/bin/g++-7
cmake ..
make -j12
But it did not work, and failed with the same message as if I tried to build with gcc-10. I tried all different variations, like the following, but none of them worked.
cmake -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7 ..
Am I missing anything?
Here is the terminal output
[seedship#triple-destinies cpsCore]$ mkdir build
[seedship#triple-destinies cpsCore]$ cd build/
[seedship#triple-destinies build]$ export CC=/usr/bin/gcc-7
[seedship#triple-destinies build]$ export CXX=/usr/bin/g++-7
[seedship#triple-destinies build]$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc-7 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-7 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/lib64/cmake/Boost-1.75.0/BoostConfig.cmake (found version "1.75.0") found components: system
Compiling with NODEBUG
-- Configuring done
-- Generating done
-- Build files have been written to: /home/seedship/cpsCore/build
[seedship#triple-destinies build]$ make -j12
Scanning dependencies of target cps_core
[ 4%] Building CXX object src/CMakeFiles/cps_core.dir/Aggregation/Aggregator.cpp.o
[ 4%] Building CXX object src/CMakeFiles/cps_core.dir/Aggregation/DynamicContainer/DynamicObjectContainer.cpp.o
[ 6%] Building CXX object src/CMakeFiles/cps_core.dir/Configuration/JsonPopulator.cpp.o
[ 11%] Building CXX object src/CMakeFiles/cps_core.dir/Configuration/TerminalConfigurator.cpp.o
[ 11%] Building CXX object src/CMakeFiles/cps_core.dir/Configuration/Configuration.cpp.o
[ 13%] Building CXX object src/CMakeFiles/cps_core.dir/Synchronization/AggregatableRunner.cpp.o
[ 16%] Building CXX object src/CMakeFiles/cps_core.dir/Synchronization/SimpleRunner.cpp.o
[ 18%] Building CXX object src/CMakeFiles/cps_core.dir/Synchronization/SynchronizedRunner.cpp.o
[ 20%] Building CXX object src/CMakeFiles/cps_core.dir/Synchronization/SynchronizedRunnerMaster.cpp.o
[ 23%] Building CXX object src/CMakeFiles/cps_core.dir/Framework/PluginManager.cpp.o
[ 25%] Building CXX object src/CMakeFiles/cps_core.dir/Framework/Helper.cpp.o
[ 27%] Building CXX object src/CMakeFiles/cps_core.dir/Logging/CPSLogger.cpp.o
[ 30%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/LinearAlgebra.cpp.o
In file included from /home/seedship/cpsCore/src/Configuration/TerminalConfigurator.cpp:5:0:
/home/seedship/cpsCore/include/cpsCore/Configuration/TerminalConfigurator.h: In member function ‘bool TerminalConfigurator::configure(ConfObj&)’:
/home/seedship/cpsCore/include/cpsCore/Configuration/TerminalConfigurator.h:49:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
/home/seedship/cpsCore/include/cpsCore/Configuration/TerminalConfigurator.h: In member function ‘TerminalConfigurator& TerminalConfigurator::operator&(Param&)’:
/home/seedship/cpsCore/include/cpsCore/Configuration/TerminalConfigurator.h:67:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
[ 32%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/Packet.cpp.o
[ 34%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/SignalHandler/SignalHandler.cpp.o
[ 37%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/TimeProvider/SystemTimeProvider.cpp.o
[ 39%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/Scheduler/MicroSimulator.cpp.o
[ 41%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/Scheduler/ExternalSimulator.cpp.o
[ 44%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/Scheduler/MultiThreadingScheduler.cpp.o
[ 46%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/Scheduler/Event.cpp.o
In file included from /usr/include/boost/property_tree/json_parser/detail/parser.hpp:7:0,
from /usr/include/boost/property_tree/json_parser/detail/read.hpp:13,
from /usr/include/boost/property_tree/json_parser.hpp:16,
from /home/seedship/cpsCore/src/Framework/Helper.cpp:7:
/usr/include/boost/bind.hpp:41:1: note: #pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
)
^
In file included from /usr/include/boost/property_tree/json_parser/detail/parser.hpp:7:0,
from /usr/include/boost/property_tree/json_parser/detail/read.hpp:13,
from /usr/include/boost/property_tree/json_parser.hpp:16,
from /home/seedship/cpsCore/src/Configuration/Configuration.cpp:5:
/usr/include/boost/bind.hpp:41:1: note: #pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
)
^
[ 48%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/Scheduler/EventBody.cpp.o
[ 51%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IPC/IPC.cpp.o
[ 53%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IPC/Subscription.cpp.o
[ 55%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp.o
[ 58%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp.o
[ 60%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IPC/detail/MessageQueuePublisherImpl.cpp.o
[ 62%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IPC/detail/SharedMemoryPublisherImpl.cpp.o
[ 65%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IDC/NetworkLayer/Serial/SerialHandler.cpp.o
[ 67%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IDC/NetworkLayer/Serial/SerialNetworkLayer.cpp.o
[ 69%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IDC/NetworkLayer/Redis/RedisPublisher.cpp.o
In file included from /home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:11:0:
/home/seedship/cpsCore/include/cpsCore/Utilities/IPC/detail/MessageQueueSubscriptionImpl.h:45:7: error: ‘atomic_bool’ in namespace ‘std’ does not name a type
std::atomic_bool listenerCanceled_;
^~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp: In constructor ‘MessageQueueSubscriptionImpl::MessageQueueSubscriptionImpl(const string&, std::size_t)’:
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:15:62: error: class ‘MessageQueueSubscriptionImpl’ does not have any field named ‘listenerCanceled_’
messageQueue_(boost::interprocess::open_only, id.c_str()), listenerCanceled_(false), maxPacketSize_(
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp: In destructor ‘virtual MessageQueueSubscriptionImpl::~MessageQueueSubscriptionImpl()’:
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:22:7: error: ‘listenerCanceled_’ was not declared in this scope
if (!listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:22:7: note: suggested alternative: ‘listenerThread_’
if (!listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
listenerThread_
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp: In member function ‘virtual void MessageQueueSubscriptionImpl::cancel()’:
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:31:2: error: ‘listenerCanceled_’ was not declared in this scope
listenerCanceled_.store(true);
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:31:2: note: suggested alternative: ‘listenerThread_’
listenerCanceled_.store(true);
^~~~~~~~~~~~~~~~~
listenerThread_
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp: In member function ‘void MessageQueueSubscriptionImpl::onMessageQueue()’:
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:54:7: error: ‘listenerCanceled_’ was not declared in this scope
if (listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:54:7: note: suggested alternative: ‘listenerThread_’
if (listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
listenerThread_
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:79:7: error: ‘listenerCanceled_’ was not declared in this scope
if (listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp:79:7: note: suggested alternative: ‘listenerThread_’
if (listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
listenerThread_
In file included from /home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp:12:0:
/home/seedship/cpsCore/include/cpsCore/Utilities/IPC/detail/SharedMemorySubscriptionImpl.h:47:7: error: ‘atomic_bool’ in namespace ‘std’ does not name a type
std::atomic_bool listenerCanceled_;
^~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp: In constructor ‘SharedMemorySubscriptionImpl::SharedMemorySubscriptionImpl(const string&)’:
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp:18:92: error: class ‘SharedMemorySubscriptionImpl’ does not have any field named ‘listenerCanceled_’
sharedMem_(boost::interprocess::open_only, id.c_str(), boost::interprocess::read_write), listenerCanceled_(
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp: In member function ‘virtual void SharedMemorySubscriptionImpl::cancel()’:
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp:33:2: error: ‘listenerCanceled_’ was not declared in this scope
listenerCanceled_.store(true);
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp:33:2: note: suggested alternative: ‘listenerThread_’
listenerCanceled_.store(true);
^~~~~~~~~~~~~~~~~
listenerThread_
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp: In destructor ‘virtual SharedMemorySubscriptionImpl::~SharedMemorySubscriptionImpl()’:
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp:40:7: error: ‘listenerCanceled_’ was not declared in this scope
if (!listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp:40:7: note: suggested alternative: ‘listenerThread_’
if (!listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
listenerThread_
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp: In member function ‘void SharedMemorySubscriptionImpl::onSharedMemory()’:
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp:73:7: error: ‘listenerCanceled_’ was not declared in this scope
if (listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
/home/seedship/cpsCore/src/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp:73:7: note: suggested alternative: ‘listenerThread_’
if (listenerCanceled_.load())
^~~~~~~~~~~~~~~~~
listenerThread_
In file included from /home/seedship/cpsCore/include/cpsCore/Utilities/IPC/IPC.h:14:0,
from /home/seedship/cpsCore/src/Utilities/Scheduler/ExternalSimulator.cpp:7:
/home/seedship/cpsCore/include/cpsCore/Utilities/IPC/detail/SharedMemorySubscriptionImpl.h:47:7: error: ‘atomic_bool’ in namespace ‘std’ does not name a type
std::atomic_bool listenerCanceled_;
^~~~~~~~~~~
[ 72%] Building CXX object src/CMakeFiles/cps_core.dir/Utilities/IDC/NetworkLayer/Redis/RedisSubscriber.cpp.o
make[2]: *** [src/CMakeFiles/cps_core.dir/build.make:381: src/CMakeFiles/cps_core.dir/Utilities/IPC/detail/MessageQueueSubscriptionImpl.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/CMakeFiles/cps_core.dir/build.make:394: src/CMakeFiles/cps_core.dir/Utilities/IPC/detail/SharedMemorySubscriptionImpl.cpp.o] Error 1
make[2]: *** [src/CMakeFiles/cps_core.dir/build.make:303: src/CMakeFiles/cps_core.dir/Utilities/Scheduler/ExternalSimulator.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:443: src/CMakeFiles/cps_core.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

Cannot find lpublic library

Trying to compile my project on Centos 8.2 using cmake 3.12, im facing with the following error:
cannot find -lpublic
here is full log:
[ 20%] Building CXX object CMakeFiles/ .cpp.o
[ 40%] Building CXX object CMakeFiles/ .cpp.o
[ 60%] Linking CXX shared library .so
[ 60%] Built target myproj
Scanning dependencies of target nist01
[ 80%] Building CXX object CMakeFiles/ .cpp.o
[100%] Linking CXX executable
/usr/bin/ld: cannot find -lpublic
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/nist01.dir/build.make:85: ...] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/...] Error 2
make: *** [Makefile:84: all] Error 2
Tried to find something on the internet, but nothing shown up.
Thanks for your help.
That seems like you try to link against the target "public", which is a suspicious target name. It might be target_link_libraries command with lowercase public instead of uppercase one, like target_link_libraryies(nist01 public something) instead of target_link_libraries(nist01 PUBLIC something).

Compiling OpenCV errors

I trying to install opencv on my raspberry pi 3b+. Iam basing on tutorial from pyimagesearch.Iam on Step #5: Compile and Install OpenCV. I got errors after I execute make command. On 15% I got errors like on the screen.
Errors:
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/fully_connected_layer.cpp.o
/home/pi/opencv-3.1.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool OutputMediaStream_FFMPEG::open(const char*, int, int, double)’:
/home/pi/opencv-3.1.0/modules/videoio/src/cap_ffmpeg_impl.hpp:2207:30: warning: ignoring return value of ‘int avformat_write_header(AVFormatContext*, AVDictionary**)’, declared with attribute warn_unused_result [-Wunused-result]
avformat_write_header(oc_, NULL);
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:154: modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4209: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/im2col.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/layers_common.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/lrn_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/mvn_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/pooling_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/reshape_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/slice_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/softmax_layer.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/split_layer.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THDiskFile.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THFile.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THGeneral.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/torch_importer.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/opencl_kernels_dnn.cpp.o
[ 23%] Linking CXX shared library ../../lib/libopencv_dnn.so
[ 23%] Built target opencv_dnn
make: *** [Makefile:163: all] Error 2
When my cmake looks like:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules \
-D ENABLE_PRECOMPILED_HEADERS=OFF \
-D WITH_TBB=OFF \
-D BUILD_EXAMPLES=ON ..
I got errors like:
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:154: modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:4209: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
I will be greateful for any advice.
Okey, I handled the problem. My solution was to install brand new Raspberry Pi Buster image on sd card. Then I installed opencv basing on another tutorial from pyimagesearch.

How to run googletest in CLion?

I want to use Googletest in my CLion Project.
So here is what I did:
I copied my googletest folder into the lib folder of my project.
I changed my CMakeLists.txt files like described in that Video: https://youtu.be/8Up5eNZ0FLw
and created that simple test:
#include "gtest/gtest.h"
TEST(basic_check, test_eq){
EXPECT_EQ(1,0);
}
I tried to run the test by pressing Shift + Ctrl + F10 and I got the following error:
"F:\Programs\CLion 2016.3\bin\cmake\bin\cmake.exe" --build C:\Users\Christian\ClionProjects\Geldautomat\cmake-build-debug --target runBasicTests -- -j 4
[ 16%] Building CXX object Tests/lib/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj
In file included from C:/Users/Christian/ClionProjects/Geldautomat/Tests/lib/googletest/include/gtest/internal/gtest-internal.h:40:0,
from C:/Users/Christian/ClionProjects/Geldautomat/Tests/lib/googletest/include/gtest/gtest.h:58,
from C:\Users\Christian\ClionProjects\Geldautomat\Tests\lib\googletest\src\gtest-all.cc:39:
C:/Users/Christian/ClionProjects/Geldautomat/Tests/lib/googletest/include/gtest/internal/gtest-port.h: In function 'int testing::internal::posix::StrCaseCmp(const char*, const char*)':
C:/Users/Christian/ClionProjects/Geldautomat/Tests/lib/googletest/include/gtest/internal/gtest-port.h:2328:25: error: '_stricmp' was not declared in this scope
return _stricmp(s1, s2);
^
mingw32-make.exe[3]: *** [Tests/lib/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj] Error 1
mingw32-make.exe[2]: *** [Tests/lib/googletest/CMakeFiles/gtest.dir/all] Error 2
mingw32-make.exe[1]: *** [Tests/basic_tests/CMakeFiles/runBasicTests.dir/rule] Error 2
mingw32-make.exe: *** [runBasicTests] Error 2
Tests\lib\googletest\CMakeFiles\gtest.dir\build.make:62: recipe for target 'Tests/lib/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj' failed
CMakeFiles\Makefile2:162: recipe for target 'Tests/lib/googletest/CMakeFiles/gtest.dir/all' failed
CMakeFiles\Makefile2:267: recipe for target 'Tests/basic_tests/CMakeFiles/runBasicTests.dir/rule' failed
Makefile:200: recipe for target 'runBasicTests' failed
My CMakeLists.txt in this directory is:
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
add_executable(runBasicTests
basic_check.cpp)
target_link_libraries(runBasicTests gtest gtest_main)
target_link_libraries(runBasicTests src)
Where my Source Code can be found in directory src.
My main.cpp is in the root directory and my Basic Test is in Tests/basic_tests
Tried the same on my Linux Notebook with CLion. Got the Error:
/home/christian/Downloads/clion-2016.3/bin/cmake/bin/cmake --build /home/christian/ClionProjects/Geldautomat/cmake-build-debug --target runBasicTests -- -j 4
Scanning dependencies of target gtest
[ 16%] Building CXX object Tests/lib/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 33%] Linking CXX static library libgtest.a
[ 33%] Built target gtest
Scanning dependencies of target gtest_main
[ 50%] Building CXX object Tests/lib/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 66%] Linking CXX static library libgtest_main.a
[ 66%] Built target gtest_main
Scanning dependencies of target runBasicTests
[ 83%] Building CXX object Tests/basic_tests/CMakeFiles/runBasicTests.dir/basic_check.cpp.o
[100%] Linking CXX executable runBasicTests
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lsrc
collect2: error: ld returned 1 exit status
Tests/basic_tests/CMakeFiles/runBasicTests.dir/build.make:97: recipe for target 'Tests/basic_tests/runBasicTests' failed
gmake[3]: *** [Tests/basic_tests/runBasicTests] Error 1
CMakeFiles/Makefile2:256: recipe for target 'Tests/basic_tests/CMakeFiles/runBasicTests.dir/all' failed
gmake[2]: *** [Tests/basic_tests/CMakeFiles/runBasicTests.dir/all] Error 2
CMakeFiles/Makefile2:268: recipe for target 'Tests/basic_tests/CMakeFiles/runBasicTests.dir/rule' failed
gmake[1]: *** [Tests/basic_tests/CMakeFiles/runBasicTests.dir/rule] Error 2
Makefile:201: recipe for target 'runBasicTests' failed
gmake: *** [runBasicTests] Error 2
It would be fine if my Project runs on Linux..
Any suggestions?
-ChrizZ
You can follow this link ->
https://www.youtube.com/channel/UCvHU1FkIE-ogFTtXnKZsqWA
There are 2 videos. Both are helpful. I set up googleTest in my CLion yesterday following the 8:19 long video.