Horje
main.cpp:(.text+0x51): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' Code Example
main.cpp:(.text+0x51): undefined reference to `cv::imread(std::__cxx11::basic_string, std::allocator > const&, int)'

That means, you're not linking some required lib,

(in your case, ALL of the opencv libs are missing from the cmdline !)

try again with:

g++ main.cpp -I/opt/robots/pepper/ctc-linux64-atom-2.5.10.7/opencv2/include/ -L/opt/robots/pepper/ctc-linux64-atom-2.5.10.7/opencv2/lib -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_videoio
main.cpp:(.text+0x51): undefined reference to `cv::imread(std::__cxx11::basic_string, std::allocator > const&, int)'
 --> My custom command that live sin my /usr/bin folder , that runs my cv2 cpp files  just fine without any problems  
 --> that may help someone 

#!/bin/bash 

file=$@

if [ "${file: -4}" = ".cpp"  ]; then 
        g++ $file -I/opt/robots/pepper/ctc-linux64-atom-2.5.10.7/opencv2/include/ -L/opt/robots/pepper/ctc-linux64-atom-2.5.10.7/opencv2/lib -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_videoio 
    if $status ; then 
        ./a.out && rm -rf a.out
    fi
else
    echo "This Command should be used only with cpp files that uses the opencv library !!"
fi




Cpp

Related
have unique vector after sorting vector Code Example have unique vector after sorting vector Code Example
creator of C++ Code Example creator of C++ Code Example
why can not return char in cpp Code Example why can not return char in cpp Code Example
qt remove resize handle Code Example qt remove resize handle Code Example
ue4 cpp OnHit Code Example ue4 cpp OnHit Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9