Ask Your Question
0

Trying to compile character_recognition.cpp

asked 2017-01-23 17:10:26 -0600

Feddav gravatar image

Hi, i've just installed opencv 3.2 and tesseract module. Now i'm tryng to compile the character_recognition.cpp sample in the opencv_contrib folder. If I use the command "pkg-config --cflags --libs opencv " it displays me

-I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dpm -lopencv_freetype -lopencv_fuzzy -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_plot -lopencv_dnn -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core

But if i try to compile che cpp file

g++ -ggdb `pkg-config --cflags --libs opencv` character_recognition.cpp -o  character_recognition

it says me that "cv::imread(cv::String const&, int)" it's not defined and this kind of error for every function of the opencv libraries that is used in the code.

Seems thats i can't link the libraries. Can you help me? thanks

edit retag flag offensive close merge delete

Comments

Can you at least at the code also? We do not have a glass ball predicting what is happening ...

StevenPuttemans gravatar imageStevenPuttemans ( 2017-01-24 08:20:42 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-01-25 02:10:05 -0600

Feddav gravatar image

i solved it using g++ -ggdb character_recognition.cpp -o character_recognition pkg-config --cflags --libs opencv Instead of g++ -ggdb pkg-config --cflags --libs opencv character_recognition.cpp -o character_recognition

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-01-23 17:10:26 -0600

Seen: 239 times

Last updated: Jan 23 '17