0

我想用std::async为静态类测试以下函数,我的主要目的是等到函数执行。但我面临以下错误。有人可以给我这个错误的原因。

IASD* ASDInterface = getASD();//gets the instance corrcet and tested function successfully

auto habnd = std::async(std::launch::async, &IASD::handle_request, ASDInterface ,arb_id, sid, data, size);

调试上述行后,我收到以下错误。

错误 LNK2019:未解析的外部符号 __imp___CrtDbgReportW 在函数“受保护:__thiscall Concurrency::details::_RefCounter::_RefCounter(long)”中引用 (??0_RefCounter@details@Concurrency@@IAE@J@Z)

有人可以回答我为什么我会遇到错误。

太感谢了。

4

1 回答 1

1

我认为它与std::async直接无关,
我怀疑代码生成选项卡上的运行时选项不匹配

确保在 degub 构建时,“运行时库”设置为“多线程调试 /MTd”或“多线程调试 DLL /MDd”
(项目 -> 属性 -> 配置属性 -> C/C++ -> 代码生成 -> 运行时库)

于 2015-11-12T13:05:22.953 回答