Caffe: gflag编译出现问题汇总
1. 使用Unicode字符集:
出现问题
E:\CodeBase\ML\Caffe\ThirdPartySrc\gflags-master\src\gflags.cc(1340): error C2664: 'BOOL PathMatchSpecW(LPCWSTR,LPCWSTR)' : cannot convert argument 1 from 'const char *' to 'LPCWSTR'
E:\CodeBase\ML\Caffe\ThirdPartySrc\gflags-master\src\gflags.cc(1340): error C2664: 'BOOL PathMatchSpecW(LPCWSTR,LPCWSTR)' : cannot convert argument 1 from 'const char *' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
E:\CodeBase\ML\Caffe\ThirdPartySrc\gflags-master\src\gflags.cc(1341): error C2664: 'BOOL PathMatchSpecW(LPCWSTR,LPCWSTR)' : cannot convert argument 1 from 'const char *' to 'LPCWSTR'
E:\CodeBase\ML\Caffe\ThirdPartySrc\gflags-master\src\gflags.cc(1341): error C2664: 'BOOL PathMatchSpecW(LPCWSTR,LPCWSTR)' : cannot convert argument 1 from 'const char *' to 'LPCWSTR'
2.使用多字符集:
出现问题:
gflags.obj : error LNK2019: unresolved external symbol __imp_PathMatchSpecA referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl google::`anonymous namespace'::CommandLineFlagParser::ProcessOptionsFromStringLocked(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum google::FlagSettingMode)" (?ProcessOptionsFromStringLocked@CommandLineFlagParser@?A0x2a9c2311@google@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV45@W4FlagSettingMode@3@@Z)
E:\CodeBase\ML\Caffe\ThirdPartySrc\gflags-sol\lib\Release\gflags_static.lib : fatal error LNK1120: 1 unresolved externals
gflags.obj : error LNK2019: unresolved external symbol __imp_PathMatchSpecA referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl google::`anonymous namespace'::CommandLineFlagParser::ProcessOptionsFromStringLocked(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum google::FlagSettingMode)" (?ProcessOptionsFromStringLocked@CommandLineFlagParser@?A0x2a9c2311@google@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV45@W4FlagSettingMode@3@@Z)
E:\CodeBase\ML\Caffe\ThirdPartySrc\gflags-sol\lib\Release\gflags_nothreads_static.lib : fatal error LNK1120: 1 unresolved externals
无法定位的外部函数????
3.出现此问题参考文章:Google开源命令行参数解析库gflags
查阅资料发现是没有链接上shlwapi.lib,而shlwapi.lib是已经被废弃的库;链接上shlwapi.lib库后再次编译链接就OK了。
考虑到shlwapi.lib和gflags库都是静态库,因此可以在生成gflags库时链接上shlwapi.lib,这样在应用程序中就不用额外地再链接上shlwapi.lib了。
另外需要注意的是,在VS【属性】-【调试】中设置的原始命令行参数argv[]中表示字符串内容不仅仅是设置的相应字符串,他会在字符串前加上工程路径名,而gflags中就没有了工程路径名,设置的多少就是多少。
解决方法:
在linker里面添加 ShLwApi.Lib
然后配置:static 为静态库;配置 gflag为动态库;
4. 出现
error LNK2001: unresolved external symbol __DllMainCRTStartup@12
解决方法:
添加:msvcrt.lib
5.关于编译glog
glog依然使用了gflag,也需要引用 ShLwApi.Lib 库
Caffe: gflag编译出现问题汇总的更多相关文章
- 深度学习框架Caffe的编译安装
深度学习框架caffe特点,富有表达性.快速.模块化.下面介绍caffe如何在Ubuntu上编译安装. 1. 前提条件 安装依赖的软件包: CUDA 用来使用GPU模式计算. 建议使用 7.0 以上最 ...
- 64位win10+cuda8.0+vs2013+cuDNN V5下Caffe的编译安装教程并配置matlab2014a 接口
一.需要安装的软件 1)vs2013,我是在http://www.52pojie.cn/thread-492326-1-1.html这个网址安装的.我之前用的是vs2012,按照网上的配置教程会爆各种 ...
- caffe windows编译
MicroSoft维护的caffe已经作为官方的caffe分支了,编译方式也改了,刚好最近重装了一次caffe windows, 记录一下里面的坑 https://github.com/BVLC/ca ...
- caffe make 编译
其实嘛,出现这个的原因在于,已经编译过啦,没有任何改动,那还烦劳编译啥呢. 那Linux又是如何知道已经编译过了呢? 那就要看makefile的规则啦.makefile的规则是所想产生的文件需要依赖很 ...
- 多标签caffe重新编译
说明: Caffe自带的图像转LMDB接口只支持单label,对于多label的任务,可以使用HDF5的格式,也可以通过修改caffe代码来实现.本篇文章介绍怎么通过修改DataLayer来实现带Mu ...
- c++ 编译报错汇总(随时更新)
1.invalid new-expression of abstract class type ‘×××ב 这个报错代表一个尝试在实例化一个抽象类,也就是说父类的接口中有纯虚函数在子类中没有实现: ...
- 配置caffe中出现的问题汇总
1,运行下面代码时: sudo apt-get install libopencv 出错: E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系 原因: 源(source ...
- caffe安装编译问题-ImportError: No module named google.protobuf.internal
问题描述 ~/Downloads/caffe$ python Python (default, Dec , ::) [GCC ] on linux2 Type "help", &q ...
- caffe安装编译问题-ImportError: No module named skimage.io
问题描述 >>> import caffe Traceback (most recent call last): File , in <module> File , in ...
随机推荐
- LeetCode 712. Minimum ASCII Delete Sum for Two Strings
Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal. ...
- scrapy——3 crawlSpider——爱问
scrapy——3 crawlSpider crawlSpider 爬取一般网站常用的爬虫类.其定义了一些规则(rule)来提供跟进link的方便的机制. 也许该spider并不是完全适合您的特定网 ...
- Java基础学习总结(73)——Java最新面试题汇总
1.super()与this()的区别? this():当前类的对象,super父类对象. super():在子类访问父类的成员和行为,必须受类继承规则的约束 而this他代表当前对象,当然所有的资源 ...
- noip模拟赛 PA
分析:很显然这是一道搜索题,可能是由于我的搜索打的太不美观了,这道题又WA又T......如果对每一个询问都做一次bfs是肯定会T的,注意到前70%的数据范围,N的值都相等,我们可以把给定N的所有情况 ...
- nyoj 310二分+dinic
#include<stdio.h> #include<queue> #include<string.h> using namespace std; #define ...
- CI笔记
1.控制器 实现自己的控制器MY_Controller是在./application/core/MY_Controller.php中. 2.类库 添加自己的类是放在./application./lib ...
- asp.net--解决上传文件大小限制
原文地址 第一种方法,主要适用于IIS6.0版本 一.修改配置Web.Config文件中的httpRuntime节点 对于asp.net,默认只允许上传4M文件,增加如下配置,一般可以自定义最大文件大 ...
- asp.net--mvc--异步编程
Using Asynchronous Methods in ASP.NET MVC 4 asp.net mvc中的异步只能增加系统的性能,原来需要500个线程的,现在需要50个就够了,对一些常规的程序 ...
- [转]十五天精通WCF——第十一天 如何对wcf进行全程监控
说点题外话,我们在玩asp.net的时候,都知道有一个叼毛玩意叫做“生命周期”,我们可以用httpmodule在先于页面的page_load中 做一些拦截,这样做的好处有很多,比如记录日志,参数过滤, ...
- python getaddrinfo 函数
现在python中用到的关于地址查询的函数几乎都可以用getaddrinfo. 也就是说,如果你要想做一些与地址查询,主机名ip转换的操作,都可以用这个函数,下面看一下这个函数. 首先,我们可以用ge ...