使用boost库,VS生成的时候一直报错,

error LNK2019: 无法解析的外部符号 "void __cdecl boost::throw_exception(class std::exception const &)"

搜索网上资料得知,可能是使用的boost库默认定义了BOOST_NO_EXCEPTIONS宏,需要用户自定义throw_exception函数,在报错的那个cpp中添加如下函数

void throw_exception(std::exception const & e) // user defined
{
return;
}

结果还是一直报错,然后添加各种预定宏也解决不了。

后来查看<boost\throw_exception.hpp>发现,应该使用namespace boost

namespace boost
{
#ifdef BOOST_NO_EXCEPTIONS void throw_exception( std::exception const & e ); // user defined #else
//省略若干
#endif
} // namespace boost

在报错的那个cpp中添加如下函数后解决

namespace boost
{
void throw_exception(std::exception const & e) // user defined
{
return;
}
}

最后,感谢http://blog.csdn.net/is2120/article/details/6385304

unresolved external symbol boost::throw_exception的更多相关文章

  1. OpenSceneGraph 编译 error LNK2019:unresolved external symbol 错误

    在编译 OpenSceneGraph 的一个简单示例时, #include <osgViewer/Viewer> #include <osgDB/ReadFile> void ...

  2. VC++ : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<wchar_t,struct std::char_traits<wchar_t>

    最近学习Google Breakpad,将其用在了自己的项目中,编译的版本为VS2010,没有什么问题.但是为了和之前的程序兼容,需要使用VS2008版本的程序,于是又编译了VS2008版本的代码,但 ...

  3. error LNK2019:unresolved external symbol

    error LNK2019:unresolved external symbol 这个错误是指程序不认识函数.具体的说就是.h文件中定义并没有实现,这就是库出现了问题. 遇到这个问题,第一步就要看是哪 ...

  4. (C++) LNK2019: unresolved external symbol.

    Error 33 error LNK2019: unresolved external symbol "\xxx.obj yyy.Native 仔细看看错误信息,后来发现尽然是构造函数的一个 ...

  5. c++模板使用出错情况error LNK2019: unresolved external symbol "public: float __thiscall Compare<float>::min(void)" (?min@?$Compare@M@@QAEMXZ) referenced in function _main

    将类模板在头文件中定义,类的成员函数在头文件中声明,头文件中只留下接口,函数的实现在另一个.cpp文件中,这样编译出来错误error LNK2019: unresolved external symb ...

  6. 解决libcurl7.50.3在windows XP SP3 VC++ 6.0下编译报错 unresolved external symbol __imp__IdnToAscii@20 unresolved external symbol __imp__IdnToUnicode@20

    错误重现: --------------------Configuration: curl - Win32 LIB Debug DLL Windows SSPI DLL WinIDN--------- ...

  7. 链接报error LNK2019: unresolved external symbol错误,解决

    http://blog.163.com/aiding_001/blog/static/22908192011102224344450/ 某次编写一个COM组件,接口定义好之后,增加了ZRX代码后编译链 ...

  8. [异常] VC6.0 error LNK2001: unresolved external symbol _main解决办法

    来自:http://www.douban.com/note/65638800/ 学习VC++时经常会遇到链接错误LNK2001,该错误非常讨厌,因为对于编程者来说,最好改的错误莫过于编译错误,而一般说 ...

  9. VC6.0 error LNK2001: unresolved external symbol _main解决办法

    学习VC++时经常会遇到链接错误LNK2001,该错误非常讨厌,因为对于编程者来说,最好改的错误莫过于编译错误,而一般说来发生连接错误时,编译都已通过.产生连接错误的原因非常多,尤其LNK2001错误 ...

随机推荐

  1. 批量插入bulkcopy

     public static void InsertBatch<T>(IDbConnection conn, IEnumerable<T> entityList, string ...

  2. C# DataGridView下DataGridViewComboBoxColumn二级联动

    效果: 代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Da ...

  3. List和ArrayList的区别

    List是一个接口,而ListArray是一个类. ListArray继承并实现了List. 所以List不能被构造,但可以向上面那样为List创建一个引用,而ListArray就可以被构造. Lis ...

  4. django model数据 时间格式

    from datetime import datetime dt = datetime.now() print '时间:(%Y-%m-%d %H:%M:%S %f): ' , dt.strftime( ...

  5. SpringBoot一站式启动流程源码分析

    一.前言 由上篇文章我们得知,SpringBoot启动时,就是有很简单的一行代码.那我们可以很清楚的看到这行代码的主角便是SpringApplication了,本文我们就来聊一聊这货,来探寻Sprin ...

  6. Log4Net使用详解1

    log4net是一个功能著名的开源日志记录组件.利用log4net可以方便地将日志信息记录到文件.控制台.Windows事件日志和数据库(包括MS SQL Server, Access, Oracle ...

  7. vue axios封装以及API统一管理

    在vue项目中,每次和后台交互的时候,经常用到的就是axios请求数据,它是基于promise的http库,可运行在浏览器端和node.js中.当项目越来越大的时候,接口的请求也会越来越多,怎么去管理 ...

  8. LearnOpenGL学习笔记(六)——纹理单元

    #version 330 core out vec4 FragColor; in vec3 ourColor; in vec2 TexCoord; uniform sampler2D ourTextu ...

  9. PHP错误解决:Fatal error: Unknown: Failed opening required ...

    最近学习PHP,使用XAMPP在Ubuntu下配置完Apache等之后,尝试了一下,但出现如下错误: Warning: Unknown: failed to open stream: 鏉冮檺涓嶅 i ...

  10. memcached优化方案实例

    <?php //引入memcached require_once '../class/memcached.class.php'; //连接MySQL $link = mysqli_connect ...