OpenCV設定及編譯: 因為遇到segmentation fault問題

寫作業要用到OpenCV,不想使用VC、.net,所以還是拿code::blocks來用囉

首先要設定lib搜尋位置,

C:Program FilesOpenCVlib

然後是include檔的位置,

C:Program FilesOpenCVcxcoreinclude
C:Program FilesOpenCVcvinclude
C:Program FilesOpenCVcvauxinclude
C:Program FilesOpenCVmlinclude
C:Program FilesOpenCVotherlibshighgui
C:Program FilesOpenCVotherlibscvcaminclude

還要再linker setting中設定,

C:Program FilesOpenCVlibcv.lib
C:Program FilesOpenCVlibcvaux.lib
C:Program FilesOpenCVlibcvcam.lib
C:Program FilesOpenCVlibcxcore.lib
C:Program FilesOpenCVlibhighgui.lib

設定完後,拿範例程式來編譯,結果執行中出現segmentation fault,找了一些資料才知道要在other linker option裡面加上-lhighgui才可以正確執行程式。

發佈留言