升压符号未找到 [英] Boost symbol not found

查看:222
本文介绍了升压符号未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译/端口的OpenOffice的旧版本。它采用升压v1.34.1,这是源代码树的一部分。该错误消息如下:

I'm trying to compile/port an older version of OpenOffice. It uses Boost v1.34.1, which is part of the source tree. The error message is as follows:

Undefined symbols:
  "boost::throw_exception(std::exception const&)", referenced from:
      boost::detail::shared_count::shared_count<ScToken>(ScToken*)in detfunc.o
ld: symbol(s) not found

升压是新的给我,我一直没能找到很多在线帮助我理解这一点。从错误信息,我知道我可能需要链接库。然而,的boost :: throw_exception 在没有匹配库中的头文件中定义(即我能找到)。只是踢,我试过的#include&LT;升压/ throw_exception.hpp&GT; 在detfunc并使用符号链接放在头文件中,没有运气同一目录中。

Boost is new to me, and I haven't been able to find much online to help me understand this. From the error message, I understand that I probably need to link a library. However, boost::throw_exception is defined in a header file with no matching library (that I can find). Just for kicks, I've tried #include <boost/throw_exception.hpp> in detfunc and using symbolic links to put the header file in the same directory with no luck.

有一个图书馆,我应该用 -l <​​/ code>来连接或包括 -I 路径?我应该如何获得该符号中引用?

Is there a library I should be linking with -l or an include path with -I? How should I get that symbol referenced in?

推荐答案

升压预计该项目无论是宏观 BOOST_NO_EXCEPTIONS 未定义的建成,或定义函数的boost :: throw_exception 本身。

Boost expects the project either to be built with macro BOOST_NO_EXCEPTIONS undefined, or to define the function boost::throw_exception itself.

&LT;升压/ throw_exception.hpp&GT; 在1.34.1版本:

From <boost/throw_exception.hpp> in version 1.34.1:

namespace boost
{

#ifdef BOOST_NO_EXCEPTIONS

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

#else

//[Not user defined --Dynguss]
template<class E> inline void throw_exception(E const & e)  
{
    throw e;
}

#endif

} // namespace boost

Boost的配置标题将决定是否定义宏与否。它看起来像它归结为您所使用的编译器,但有可能是其他因素。以在对应于你的编译器头文件中的升压/配置/编译器/ 文件夹的样子,然后搜索 BOOST_NO_EXCEPTIONS 在里面。应该有周围的一些条件的#define 帮助时,升压定义它解释。您可以到您的构建配置,以避免定义并获得过去,你所遇到的链接错误。

Boost's configuration headers will determine whether to define the macro or not. It looks like it boils down to the compiler you're using, but there may be other factors. Take a look in the boost/config/compiler/ folder for the header file that corresponds to your compiler, then search for BOOST_NO_EXCEPTIONS in it. There should be some conditions around the #define to help explain when Boost defines it. You may be able to configure your build to avoid the definition and get past the linker error you're experiencing.

如果您无法改变你的编译器的配置,以避免定义,那么你很可能离开定义的boost :: throw_exception(性病::例外常量急症)自己某处的OpenOffice code。我不熟悉与code,虽然,所以我不能给一个很好的建议,它应该走了。

If you're unable to change your compiler config to avoid the definition, then you're probably left defining boost::throw_exception(std::exception const & e) yourself somewhere in the OpenOffice code. I'm unfamiliar with that code, though, so I can't give a good suggestion where it should go.

这篇关于升压符号未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆