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编译出现问题汇总的更多相关文章

  1. 深度学习框架Caffe的编译安装

    深度学习框架caffe特点,富有表达性.快速.模块化.下面介绍caffe如何在Ubuntu上编译安装. 1. 前提条件 安装依赖的软件包: CUDA 用来使用GPU模式计算. 建议使用 7.0 以上最 ...

  2. 64位win10+cuda8.0+vs2013+cuDNN V5下Caffe的编译安装教程并配置matlab2014a 接口

    一.需要安装的软件 1)vs2013,我是在http://www.52pojie.cn/thread-492326-1-1.html这个网址安装的.我之前用的是vs2012,按照网上的配置教程会爆各种 ...

  3. caffe windows编译

    MicroSoft维护的caffe已经作为官方的caffe分支了,编译方式也改了,刚好最近重装了一次caffe windows, 记录一下里面的坑 https://github.com/BVLC/ca ...

  4. caffe make 编译

    其实嘛,出现这个的原因在于,已经编译过啦,没有任何改动,那还烦劳编译啥呢. 那Linux又是如何知道已经编译过了呢? 那就要看makefile的规则啦.makefile的规则是所想产生的文件需要依赖很 ...

  5. 多标签caffe重新编译

    说明: Caffe自带的图像转LMDB接口只支持单label,对于多label的任务,可以使用HDF5的格式,也可以通过修改caffe代码来实现.本篇文章介绍怎么通过修改DataLayer来实现带Mu ...

  6. c++ 编译报错汇总(随时更新)

    1.invalid new-expression of abstract class type ‘×××ב 这个报错代表一个尝试在实例化一个抽象类,也就是说父类的接口中有纯虚函数在子类中没有实现: ...

  7. 配置caffe中出现的问题汇总

    1,运行下面代码时: sudo apt-get install libopencv 出错: E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系 原因: 源(source ...

  8. caffe安装编译问题-ImportError: No module named google.protobuf.internal

    问题描述 ~/Downloads/caffe$ python Python (default, Dec , ::) [GCC ] on linux2 Type "help", &q ...

  9. caffe安装编译问题-ImportError: No module named skimage.io

    问题描述 >>> import caffe Traceback (most recent call last): File , in <module> File , in ...

随机推荐

  1. 第2章 Python序列

    Python序列类似于C或Basic中的一维.多维数组等,但功能要强大很多,使用也更加灵活.方便,Head First Python一书就戏称列表是“打了激素”的数组. Python中常用的序列结构有 ...

  2. 《你说对就队》第八次团队作业:Alpha冲刺 第五天

    <你说对就队>第八次团队作业:Alpha冲刺 第五天 项目 内容 这个作业属于哪个课程 [教师博客主页链接] 这个作业的要求在哪里 [作业链接地址] 团队名称 <你说对就队> ...

  3. Vladik and Entertaining Flags

    Vladik and Entertaining Flags time limit per test 2 seconds memory limit per test 256 megabytes inpu ...

  4. [转]C#综合揭秘——深入分析委托与事件

    引言 本篇文章将为你介绍一下 Delegate 的使用方式,逐渐揭开 C# 当中事件(Event)的由来,它能使处理委托类型的过程变得更加简单.还将为您解释委托的协变与逆变,以及如何使用 Delega ...

  5. Maven: java.lang.ClassNotFoundException: org.eclipse.aether.spi.connector.Transfer$State

    在mac中使用maven compile时发生以下错误: Maven: java.lang.ClassNotFoundException: org.eclipse.aether.spi.connect ...

  6. linux下的C语言开发(gdb调试)

    原文: http://blog.csdn.net/feixiaoxing/article/details/7199643 用gdb调试多进程的程序会遇到困难,gdb只能跟踪一个进程(默认是跟踪父进程) ...

  7. HDU--1054--Strategic Game【最小点覆盖】

    链接:pid=1054">http://acm.hdu.edu.cn/showproblem.php?pid=1054 题意:一个熊孩子玩策略游戏,他须要用最少的士兵守卫最多的道路.假 ...

  8. 我们的一个已投产项目的高可用数据库实战 - mongo 副本集的搭建具体过程

    我们的 mongo 副本集有三台 mongo 服务器:一台主库两台从库. 主库进行写操作,两台从库进行读操作(至于某次读操作到底路由给了哪台,仲裁决定).实现了读写分离.这还不止,假设主库宕掉,还能实 ...

  9. 605B. Lazy Student(codeforces Round 335)

    B. Lazy Student time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...

  10. 一个效果非常华丽的仿桌面APP,却胜似Launcher

    开发Android APP的同学是否对于Launcher实现的绚丽效果而痴迷呢?什么.连Android Launcher是什么都不知道.好吧,拿起侬的手机.在解锁后的首页界面上左右滑动滑动,体验体验, ...