gpt4 book ai didi

c++ - 未解析的外部符号 “void __cdecl boost::tss_cleanup_implemented(void)”

转载 作者:行者123 更新时间:2023-12-01 15:02:30 25 4
gpt4 key购买 nike

当我尝试搜索此错误时,我感到非常惊讶,因为我只有4个结果,其中两个似乎是中文。在编译我的项目并将所有源代码一起提升时,我会收到此错误。我搜索了boost库,发现了这一点:

namespace boost
{
/*
This file is a "null" implementation of tss cleanup; it's
purpose is to to eliminate link errors in cases
where it is known that tss cleanup is not needed.
*/

void tss_cleanup_implemented(void)
{
/*
This function's sole purpose is to cause a link error in cases where
automatic tss cleanup is not implemented by Boost.Threads as a
reminder that user code is responsible for calling the necessary
functions at the appropriate times (and for implementing an a
tss_cleanup_implemented() function to eliminate the linker's
missing symbol error).

If Boost.Threads later implements automatic tss cleanup in cases
where it currently doesn't (which is the plan), the duplicate
symbol error will warn the user that their custom solution is no
longer needed and can be removed.
*/
}

}

我的问题是什么是tss清理,为什么需要它以及如何实现它。

最佳答案

我不了解TSS,但是要修复此链接器错误,您需要定义

BOOST_THREAD_WIN32


BOOST_THREAD_BUILD_LIB

因此 boost/thread/src/win32/tss_pe.cpp实现了缺少的功能(空)。

我认为在Internet上针对此问题的结果很少,因为构建方案很少见。大多数人不是在自己的项目中构建增强功能,而是使用b2构建增强功能。

关于c++ - 未解析的外部符号 “void __cdecl boost::tss_cleanup_implemented(void)”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33916672/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com