2014-01-29 72 views
1

我通過執行試圖建立一個C++項目C++項目時,鏈接錯誤:make,但我得到這些錯誤:OpenCV的,建築使用cmake

/usr/bin/ld: cannot find -lcv 
/usr/bin/ld: cannot find -lcxcore 
/usr/bin/ld: cannot find -lml 

和我有OpenCV的庫:

$ pkg-config --cflags --libs opencv 
    -I/usr/include/opencv -lopencv_calib3d -lopencv_contrib -lopencv_core 
    -lopencv_feathures2d -lopencv_flann -lopencv_gpu -lopencv_highgui  
    -lopencv_imgproc -lopencv_lagecy -lopencv_ml -lopencv_objdetect -lopencv_ocl 
    -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video         
    -lopencv_videostab 
+0

你的makefile引用了一些過時的opencv1.x版本 – berak

回答

1

這意味着你要求鏈接器鏈接到庫「cv,cxcore,ml」,但鏈接器找不到它們。正如BoBTFish所建議的那樣;讓pkg-config爲你做這件事:

g++ `pkg-config --libs opencv` etc...