二、 Caffe库的调用:
- 新建空白项目,将配置管理器更改为x64运行方式。(release和Debug均可)。
- Debug配置:
1) 包含目录:
- D:\caffe-master\include;
- D:\NugetPackages\glog.0.3.3.0\build\native\include;
- D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\include;
- D:\NugetPackages\OpenCV.2.4.10\build\native\include;
- D:\NugetPackages\boost.1.59.0.0\lib\native\include;
- D:\NugetPackages\gflags.2.1.2.1\build\native\include;
- D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\include;
- D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\include;
- D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\include;
- D:\NugetPackages\protobuf-v120.2.6.1\build\native\include;
2) 库目录:
- D:\caffe-master\Build\x64\Debug;
- D:\NugetPackages\OpenCV.2.4.10\build\native\lib\x64\v120\Debug;
- D:\NugetPackages\boost_chrono-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\boost_date_time-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\boost_filesystem-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\boost_system-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\boost_thread-vc120.1.59.0.0\lib\native\address-model-64\lib;
- D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib;
- D:\NugetPackages\glog.0.3.3.0\build\native\lib\x64\v120\Debug\dynamic;
- D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\lib\x64;
- D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\lib\x64\v120\Debug;
- D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\lib\x64;
- D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\lib\x64;
- D:\NugetPackages\protobuf-v120.2.6.1\build\native\lib\x64\v120\Debug;
- D:\NugetPackages\boost_date_time-vc120.1.59.0.0\lib
3) 链接器-->输入:
caffe.lib
compute_image_mean.lib
convert_imageset.lib
convert_mnist_data.lib
libcaffe.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_objdetect2410d.lib
opencv_core2410d.lib
opencv_ml2410d.lib
libboost_date_time-vc120-mt-gd-1_59.lib
libboost_filesystem-vc120-mt-gd-1_59.lib
libboost_system-vc120-mt-gd-1_59.lib
libglog.lib
hdf5.lib
hdf5_cpp.lib
hdf5_f90cstub.lib
hdf5_fortran.lib
hdf5_hl.lib
hdf5_hl_cpp.lib
hdf5_hl_f90cstub.lib
hdf5_hl_fortran.lib
hdf5_tools.lib
szip.lib
zlib.lib
LevelDb.lib
lmdb.lib
libprotobuf.lib
libopenblas.dll.a
gflags_nothreadsd.lib
gflagsd.lib
3. release编译配置:
1) 包含目录:
和上面Debug模式下配置相同:
- D:\caffe-master\include
- D:\NugetPackages\boost.1.59.0.0\lib\native\include
- D:\NugetPackages\gflags.2.1.2.1\build\native\include
- D:\NugetPackages\glog.0.3.3.0\build\native\include
- D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\include
- D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\include
- D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\include
- D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\include
- D:\NugetPackages\OpenCV.2.4.10\build\native\include
- D:\NugetPackages\protobuf-v120.2.6.1\build\native\include
2) 库目录:
也是和Debug模式下相似:
- D:\caffe-master\Build\x64\Release
- D:\NugetPackages\boost_chrono-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\boost_date_time-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\boost_filesystem-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\boost_system-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\boost_thread-vc120.1.59.0.0\lib\native\address-model-64\lib
- D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib
- D:\NugetPackages\glog.0.3.3.0\build\native\lib\x64\v120\Release\dynamic
- D:\NugetPackages\hdf5-v120-complete.1.8.15.2\lib\native\lib\x64
- D:\NugetPackages\LevelDB-vc120.1.2.0.0\build\native\lib\x64\v120\Release
- D:\NugetPackages\lmdb-v120-clean.0.9.14.0\lib\native\lib\x64
- D:\NugetPackages\OpenBLAS.0.2.14.1\lib\native\lib\x64
- D:\NugetPackages\OpenCV.2.4.10\build\native\lib\x64\v120\Release
- D:\NugetPackages\protobuf-v120.2.6.1\build\native\lib\x64\v120\Release
3) 链接器-->输入:
opencv_core2410.lib
opencv_highgui2410.lib
opencv_imgproc2410.lib
caffe.lib
libcaffe.lib
gflags.lib
libglog.lib
libopenblas.dll.a
libprotobuf.lib
leveldb.lib
lmdb.lib
hdf5.lib
hdf5_hl.lib
libboost_date_time-vc120-mt-s-1_59.lib
libboost_filesystem-vc120-mt-s-1_59.lib
note:
先将D:\caffe-master\Build\x64下生成的Debug和release文件夹中的dll文件拷贝到项目所对应的Debug和release文件夹下。
bug修复:
- 提示错误:
解决:在链接器的命令行输入:-D_SCL_SECURE_NO_WARNINGS
2. 提示错误:
解决在路径:D:\NugetPackages\gflags.2.1.2.1\build\native\x64\v120\dynamic\Lib下。
将对应的库文件拷贝到工程项目中。项目路径为E:\Windows_caffe\caffeTest\x64\Debug。