1

I'm on Ubuntu 20.4.6, I try to compile OpenCV using the qcc QNX compiler. In OpenCV build from source instructions they use the following command to generate their build files:

cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DOPENCV_GENERATE_PKGCONFIG=ON \
-DOPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_EXAMPLES=ON ..

I thought of adding the C compiler and CXX compiler flags (CMake) to indicate to CMake to generate using qcc compiler like so:

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=qcc -DCMAKE_CXX_COMPILER=qcc \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DOPENCV_GENERATE_PKGCONFIG=ON \
-DOPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_EXAMPLES=ON ..

When I try and run the make command, to start the build process, I get many errors and warnings and eventually the build fails. I also tried to use Ninja but same thing happened.

Example erros:

[ 13%] Building CXX object modules/ml/CMakeFiles/opencv_ml.dir/src/gbt.cpp.o
/usr/bin/ld: /home/user/qnx710/target/qnx7/x86_64/lib/libc.so: warning: the use of `pthread_attr_setstackaddr' is deprecated, use `pthread_attr_setstack'
/usr/bin/ld: /home/user/qnx710/target/qnx7/x86_64/lib/libc.so: warning: the use of `pthread_attr_getstackaddr' is deprecated, use `pthread_attr_getstack'
[ 13%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/accum.dispatch.cpp.o
/usr/bin/ld: /home/user/qnx710/target/qnx7/x86_64/lib/libc.so: warning: The 'mktemp' function is dangerous. Use 'mkstemp' instead.
/usr/bin/ld: CMakeFiles/opencv_version.dir/opencv_version.cpp.o: undefined reference to symbol '__printf_chk@@GLIBC_2.3.4'
/usr/bin/ld: /lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
apps/version/CMakeFiles/opencv_version.dir/build.make:103: recipe for target 'bin/opencv_version' failed
make[2]: *** [bin/opencv_version] Error 1
CMakeFiles/Makefile2:19706: recipe for target 'apps/version/CMakeFiles/opencv_version.dir/all' failed
make[1]: *** [apps/version/CMakeFiles/opencv_version.dir/all] Error 2
[ 15%] Built target opencv_imgproc
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

Anyone knows how to use the qcc QNX compiler on a project, or if there are better compatible open source projects out there to be used with qcc?

Gal Hadar
  • 11
  • 1
  • 4

0 Answers0