基于caffe的MFC工程配置过程

参考 Windows下面用vs2013直接调用caffe的c++接口https://blog.csdn.net/xjz18298268521/article/details/61921357

1报错解决

错误 321 error C2238: 意外的标记位于“;”之前 E:\vsproject\gaomingda\PedestrianAttributes-pose-new\caffelib-ssd\include\caffe\proto\caffe.pb.h 3895 1 PedestrianAttributes
错误 323 error C2238: 意外的标记位于“;”之前 E:\vsproject\gaomingda\PedestrianAttributes-pose-new\caffelib-ssd\include\caffe\proto\caffe.pb.h 13046 1 PedestrianAttributes
错误 320 error C2059: 语法错误:“常量” E:\vsproject\gaomingda\PedestrianAttributes-pose-new\caffelib-ssd\include\caffe\proto\caffe.pb.h 3895 1 PedestrianAttributes
错误 322 error C2059: 语法错误:“常量” E:\vsproject\gaomingda\PedestrianAttributes-pose-new\caffelib-ssd\include\caffe\proto\caffe.pb.h 13046 1 PedestrianAttributes

应该将编译后的 caffe\include\caffe\proto\caffe.pb.h中的
STRICT 改为 _STRICT
PERMISSIVE 改为 _PERMISSIVE

编译出错信息:错误    1    error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.  

首先我们分析错误提示,这个方法或者变量可能是不安全的,考虑使用fopen_s来代替。若要禁用安全警告,看在线帮助的具体细节。
方法1:我们用fopen_s来代替原来的方法fopen
方法2:在c++预处理器中添加_CRT_SECURE_NO_WARNINGS的定义。
第二种方法我们可以这么做:(1)点击项目–》属性–》c/c+±-》预处理器–》预处理定义–》点击下拉按钮

2、debug

debug 链接–输入
libcaffe.lib
libopenblas.dll.a
libprotobuf.lib
opencv_highgui2410d.lib
opencv_core2410d.lib
opencv_imgproc2410d.lib
libglog.lib
gflags.lib
hdf5.lib
hdf5_hl.lib
lmdbD.lib
LevelDb.lib

gpu版本需要添加

cublas.lib
cuda.lib
curand.lib
cudart.lib

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章