二、 Caffe库的调用:
- 新建空白项目,将配置管理器更改为x64运行方式。(release和Debug均可)。
- Debug配置:
1) 包含目录:
- D:caffe-masterinclude;
- D:NugetPackagesglog.0.3.3.0uild ativeinclude;
- D:NugetPackagesOpenBLAS.0.2.14.1lib ativeinclude;
- D:NugetPackagesOpenCV.2.4.10uild ativeinclude;
- D:NugetPackagesoost.1.59.0.0lib ativeinclude;
- D:NugetPackagesgflags.2.1.2.1uild ativeinclude;
- D:NugetPackageshdf5-v120-complete.1.8.15.2lib ativeinclude;
- D:NugetPackagesLevelDB-vc120.1.2.0.0uild ativeinclude;
- D:NugetPackageslmdb-v120-clean.0.9.14.0lib ativeinclude;
- D:NugetPackagesprotobuf-v120.2.6.1uild ativeinclude;
2) 库目录:
- D:caffe-masterBuildx64Debug;
- D:NugetPackagesOpenCV.2.4.10uild ativelibx64v120Debug;
- D:NugetPackagesoost_chrono-vc120.1.59.0.0lib ativeaddress-model-64lib;
- D:NugetPackagesoost_date_time-vc120.1.59.0.0lib ativeaddress-model-64lib;
- D:NugetPackagesoost_filesystem-vc120.1.59.0.0lib ativeaddress-model-64lib;
- D:NugetPackagesoost_system-vc120.1.59.0.0lib ativeaddress-model-64lib;
- D:NugetPackagesoost_thread-vc120.1.59.0.0lib ativeaddress-model-64lib;
- D:NugetPackagesgflags.2.1.2.1uild ativex64v120dynamicLib;
- D:NugetPackagesglog.0.3.3.0uild ativelibx64v120Debugdynamic;
- D:NugetPackageshdf5-v120-complete.1.8.15.2lib ativelibx64;
- D:NugetPackagesLevelDB-vc120.1.2.0.0uild ativelibx64v120Debug;
- D:NugetPackageslmdb-v120-clean.0.9.14.0lib ativelibx64;
- D:NugetPackagesOpenBLAS.0.2.14.1lib ativelibx64;
- D:NugetPackagesprotobuf-v120.2.6.1uild ativelibx64v120Debug;
- D:NugetPackagesoost_date_time-vc120.1.59.0.0lib
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-masterinclude
- D:NugetPackagesoost.1.59.0.0lib ativeinclude
- D:NugetPackagesgflags.2.1.2.1uild ativeinclude
- D:NugetPackagesglog.0.3.3.0uild ativeinclude
- D:NugetPackageshdf5-v120-complete.1.8.15.2lib ativeinclude
- D:NugetPackagesLevelDB-vc120.1.2.0.0uild ativeinclude
- D:NugetPackageslmdb-v120-clean.0.9.14.0lib ativeinclude
- D:NugetPackagesOpenBLAS.0.2.14.1lib ativeinclude
- D:NugetPackagesOpenCV.2.4.10uild ativeinclude
- D:NugetPackagesprotobuf-v120.2.6.1uild ativeinclude
2) 库目录:
也是和Debug模式下相似:
- D:caffe-masterBuildx64Release
- D:NugetPackagesoost_chrono-vc120.1.59.0.0lib ativeaddress-model-64lib
- D:NugetPackagesoost_date_time-vc120.1.59.0.0lib ativeaddress-model-64lib
- D:NugetPackagesoost_filesystem-vc120.1.59.0.0lib ativeaddress-model-64lib
- D:NugetPackagesoost_system-vc120.1.59.0.0lib ativeaddress-model-64lib
- D:NugetPackagesoost_thread-vc120.1.59.0.0lib ativeaddress-model-64lib
- D:NugetPackagesgflags.2.1.2.1uild ativex64v120dynamicLib
- D:NugetPackagesglog.0.3.3.0uild ativelibx64v120Releasedynamic
- D:NugetPackageshdf5-v120-complete.1.8.15.2lib ativelibx64
- D:NugetPackagesLevelDB-vc120.1.2.0.0uild ativelibx64v120Release
- D:NugetPackageslmdb-v120-clean.0.9.14.0lib ativelibx64
- D:NugetPackagesOpenBLAS.0.2.14.1lib ativelibx64
- D:NugetPackagesOpenCV.2.4.10uild ativelibx64v120Release
- D:NugetPackagesprotobuf-v120.2.6.1uild ativelibx64v120Release
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-masterBuildx64下生成的Debug和release文件夹中的dll文件拷贝到项目所对应的Debug和release文件夹下。
bug修复:
- 提示错误:
解决:在链接器的命令行输入:-D_SCL_SECURE_NO_WARNINGS
2. 提示错误:
解决在路径:D:NugetPackagesgflags.2.1.2.1uild ativex64v120dynamicLib下。
将对应的库文件拷贝到工程项目中。项目路径为E:Windows_caffecaffeTestx64Debug。