【发布时间】:2016-03-23 09:17:29
【问题描述】:
我在 Visual Studio 2010 中为 64 位构建项目时遇到问题。我无法使用 boost 库构建 64 位,我遇到了错误。我可以为 32 位构建,但不能为 64 位构建。
\boost_1_49_0\boost\thread\win32\basic_timed_mutex.hpp(159): fatal error C1001: An internal error has occurred in the compiler
(compiler file 'f:\dd\vctools\compiler\utc\src\p2\wvm\mdmiscw.c', line 2704)
5 To work around this problem, try simplifying or changing the program near the locations listed above.
5> Please choose the Technical Support command on the Visual C++
5> Help menu, or open the Technical Support help file for more information
5> The command exited with code 2.
它指向以下代码的错误,当然我不能更改 boost 库。我对这个错误感到困惑
void unlock()
{
long const offset=lock_flag_value;
long const old_count=BOOST_INTERLOCKED_EXCHANGE_ADD(&active_count,lock_flag_value);
if(!(old_count&event_set_flag_value) && (old_count>offset))
{
if(!win32::interlocked_bit_test_and_set(&active_count,event_set_flag_bit))
{
win32::SetEvent(get_event());
}
}
}
你能帮帮我吗,
谢谢
已编辑:
我不确定错误在哪里,但我认为它在 boost 库中,有一个类似的 cpp 文件
Class a::a(, point, )
{
}
并且“点”是一个命名空间,它在使用boost库的头文件中定义,它具有以下代码
#include <boost/thread.hpp>
#include <boost/thread/recursive_mutex.hpp>
namespace point
{
// some work1
void fun()
{
boost::unique_lock< boost::recursive_mutex > lck(*m_RedrawMutex);
// some work2
}
// some work3
}
回答:
它终于奏效了!经过两天的搜索,我找到了另一种方法。我只是在使用boost basic_timed_mutex.hpp的项目头中更改了包含路径的顺序。我在顶部放置了 boost 包含路径,它起作用了。真奇怪!!!
【问题讨论】:
-
请发布一个展示问题的最小完整示例 - 我们可以编译和复制。你怎么看?我们是至高无上的智慧生物,可以无所不知地了解您的代码,以及编译器中的所有代码?
-
@richard 我更新了。抱歉,如果我无法联系到您。我没有 C++ 方面的经验
-
代码看起来像托管的c++,不能合理地说是c++。我已经更新了标签。
标签: visual-studio boost 64-bit managed-c++