linux下eclipse+gcc(cdt)的eclipse配置库文件(lib)方法

转自:http://www.haogongju.net/art/1526711


1、头文件:project->properties->c/c++ build->settings->gcc c++ compiler->includes

2、库文件:project->properties->c/c++ build->settings->gcc c++  link er->libraries下面
  libaries(-l):添加highgui,cv,cxcore(如:添加libtest.a 只要写test即可,不能写成libtest.a

  library search path(-L):添加lib文件所在目录


3、运行时候会报错找不到so文件,需要将/usr/local/lib添加到环境变量LD_LIBRARY_PATH,需要注意之前这个变量是否设置
  命令行:sudo vi /etc/profile
                             LD_LIBRARY_PATH=/usr/local/lib
                             export LD_LIBRARY_PATH
  eclipse:project->properties->C/C++ Build-->Settings-->Tool settings-->GCC C++ Linker-->Miscellaneous的Other options (-Xlinker [option])添加 -R/usr/local/lib

你可能感兴趣的:(linux下eclipse+gcc(cdt)的eclipse配置库文件(lib)方法)