一、环境变量配置:
export M2_HOME=/home/ustcjing/Maven/apache-maven-3.5.0export JAVA_HOME=/usr/lib/jvm8/javaexport JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=${JAVA_HOME}/bin:/root/anaconda3/bin:${M2_HOME}/bin:/home/ustcjing/SocLib/soclib/utils/bin:/home/ustcjing/Soclib/Installaion/binutils/bin:/home/ustcjing/Soclib/build/mipsel:/home/ustcjing/SocLib/Installaion/binutils/bin:$PATHexport SYSTEMC=/home/ustcjing/SystemCexport PKG_CONFIG_PATH=usr/local/lib/pkgconfig:/root/anaconda3/lib/pkgconfig:$PKG_CONFIG_PATHexport LIBRARY_PATH=/usr/lib:/usr/local/lib:/root/anaconda3/lib:$LIBRARY_PATHexport LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/root/anaconda3/lib:/root/anaconda3/bin:$LD_LIBRARY_PATHexport C_INCLUDE_PATH=/usr/local/include:/root/anaconda3/include/python3.5m:$C_INCLUDE_PATHexport CPLUS_INCLUDE_PATH=/usr/local/include:/root/anaconda3/include/python3.5m:$CPLUS_INCLUDE_PATH
二、Makefile文件
CFLAGS = -g -WallLIBS = $(shell pkg-config opencv --cflags --libs)INCLUDES=$(shell pkg-config python3 --cflags --libs)OBJS = test.cppCXX = g++all: testtest: $(OBJS) $(CXX) $(CFLAGS) $(OBJS) $(LIBS) $(INCLUDES) -o $@ clean: rm -rf *.o
三、更新Cmake
sudo add-apt-repository ppa:george-edison55/cmake-3.xsudo apt-get updatesudo apt-get upgrade cmake --version
四、OpenCv的安装参数
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D PYTHON3_EXECUTABLE=/home/ustcjing/Anaconda3/bin/python3 -D PYTHON_INCLUDE_DIR=/home/ustcjing/Anaconda3/include/python3.5m -D PYTHON_LIBRARY=/home/ustcjing/Anaconda3/lib/libpython3.5m.so -D PYTHON3_NUMPY_INCLUDE_DIRS=/home/ustcjing/Anaconda3/pkgs/numpy-1.14.0-py35h3dfced4_0/lib/python3.5/site-packages/numpy/core/include -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D PYTHON_EXECUTABLE=/home/ustcjing/Anaconda3/bin/python3 -D BUILD_TIFF=ON -D BUILD_EXAMPLES=ON ..
五、libstdc++的链接问题
ln -s libstdc++.so.6.0.24 libstdc++.so.6ln -s libstdc++.so.6.0.24 libstdc++.so