链接器错误:LNK2022

发布于 2024-08-08 10:12:47 字数 489 浏览 5 评论 0原文

我正在尝试在具有公共语言运行时支持的项目中使用升压线程。我收到以下链接器错误。错误 LNK2022:元数据操作失败 (8013119F):存在 TypeRef,它应该但没有相应的 TypeDef: (dummy): (0x01000073)。

如果我评论实例化升压线程的行,我不会收到任何链接器错误。

我尝试在网上查找修复此错误的方法,在一个这样的地方,建议在包含任何 boost 库之前使用“#define BOOST_THREAD_USE_DLL”。我尝试了这个,但它仍然给我同样的错误。

有一个相关的线程,(“LNK2022:元数据操作失败”让我发疯< /a> )但这不是同一个问题,而是有些相似。我尝试了那里建议的修复,但仍然没有运气。

有谁知道如何解决这个问题?

I am trying to use boost threads in a project having common language runtime support. I get the following linker error. error LNK2022: metadata operation failed (8013119F) : A TypeRef exists which should, but does not, have a corresponding TypeDef: (dummy): (0x01000073).

If i comment the line instantiating the boost thread, i do not get any linker error.

I tried looking online for fixing this error, at one such place it was suggested to use " #define BOOST_THREAD_USE_DLL" before including any boost libraries. I tried this but it still gives me the same error.

There is a related thread, ( "LNK2022: metadata operation failed" driving me insane ) but it isnt the same problem but somewhat similar. I tried the fix suggested there but still no luck.

Does anyone know how to fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

如日中天 2024-08-15 10:12:47
# include <boost/thread.hpp>
namespace boost {
    struct thread::dummy {};
}

这对我有帮助

# include <boost/thread.hpp>
namespace boost {
    struct thread::dummy {};
}

This helped me

神妖 2024-08-15 10:12:47

就我而言,使用 OpenCV 4.1.1 时出现类似的错误。
VS2019还可以,VS2015就不好了。错误信息是这样的。

LNK2022: metadata operation failed (8013119F) : A TypeRef exists which should, but does not, have a corresponding TypeDef: (Impl): (0x0100002a)

我在 OpenCV 包含文件中搜索了名为“Impl”的结构或类。
然后我可以避免在 #include opencv 标头下添加以下代码的错误。

namespace cv {
    namespace cuda {
        class Stream::Impl {};
    }
}
namespace cv {
    namespace cuda {
        class Event::Impl {};
    }
}

这里的答案对我非常有帮助。谢谢。

In my case, similar error occurred when using OpenCV 4.1.1.
VS2019 is OK, but VS2015 is not good. Error message is like this.

LNK2022: metadata operation failed (8013119F) : A TypeRef exists which should, but does not, have a corresponding TypeDef: (Impl): (0x0100002a)

I searched struct or class named "Impl" in OpenCV include files.
Then I could avoid the error adding the follow codes just under #include opencv headers.

namespace cv {
    namespace cuda {
        class Stream::Impl {};
    }
}
namespace cv {
    namespace cuda {
        class Event::Impl {};
    }
}

Answers in here were very helpful for me. Thank you.

走走停停 2024-08-15 10:12:47

Visual Studio 不支持右值引用。仔细检查您的升压配置选项,以确保您使用的是正确的工具集。 (请参阅 boost 文档)

另外,请确保您拥有当前版本的 boost。

-保罗H

Visual Studio doesn't support r-value references. Double-check your boost configuration options to make sure you're using the correct toolset. (see the boost documentation)

Also, ensure you have the current version of boost.

-PaulH

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文