如何在/ usr / local中排除旧版本库?

时间:2017-03-14 10:07:20

标签: opencv c++11 compilation include

Disclamer:使用-nostdcincl是不可能的,因为它排除了所需的系统库。相反,问题似乎是编译器忽略了我的-I指令

我在远程计算机上的~/local中安装了一个库(OpenCV),因为我没有sudo访问权限。请注意,/usr/local中安装了相同库的旧版本。

我正在尝试编译此代码:

g++ -DCC_DISABLE_CUDA -I/home/spm1428/CloudCache -I/home/spm1428/local/include/opencv -I/home/spm1428/local/include/opencv2 -I/usr/include/boost -I/home/spm1428/vlfeat -O3 -g -Wall -c -fopenmp -std=c++11 -c -o Descriptor.o ../Descriptors/Descriptor.cpp

但是,返回的错误是:

In file included from /usr/local/include/opencv2/opencv.hpp:77:0,
                 from /home/spm1428/CloudCache/Utilities/Utility.hpp:11,
                 from ../Descriptors/Descriptor.cpp:17:
/usr/local/include/opencv2/highgui/highgui.hpp:165:25: error: redeclaration of ‘IMREAD_UNCHANGED’
     IMREAD_UNCHANGED  =-1,
                         ^
In file included from ../Descriptors/Descriptor.cpp:13:0:
/home/spm1428/local/include/opencv2/imgcodecs.hpp:65:8: note: previous declaration ‘cv::ImreadModes IMREAD_UNCHANGED’
        IMREAD_UNCHANGED            = -1, //!< If set, return the loaded image as is (with alpha channel,
        ^
In file included from /usr/local/include/opencv2/opencv.hpp:77:0,
                 from /home/spm1428/CloudCache/Utilities/Utility.hpp:11,
                 from ../Descriptors/Descriptor.cpp:17:
/usr/local/include/opencv2/highgui/highgui.hpp:167:24: error: redeclaration of ‘IMREAD_GRAYSCALE’
     IMREAD_GRAYSCALE  =0,

我认为这是因为安装了另一个版本。我怎么解决这个问题?

我认为this error出于同样的原因(旧版本没有cv::xfeatures2d::SURF)。

0 个答案:

没有答案