gpt4 book ai didi

c++ - Clang 发出有关不受支持的 __declspec 属性的警告

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:20:49 31 4
gpt4 key购买 nike

我一直在尝试将第三方库链接到我的程序。工具链使用 Clang 4.0.0 进行编译(emscripten 1.37.19 在工具链中使用了 clang)。我收到了一个关于 __declspec 的错误,在查找之后,我意识到我需要将 -fdeclspec 参数添加到 clang。但是,现在我收到此警告:

warning: __declspec attribute 'dllimport' is not supported [-Wignored-attributes]

Clang 4.0 文档说这个属性应该被 AFAIK 支持。我在这里错过了什么吗?

最佳答案

-fdeclspec如果您使用 __declspec(dllexport),应该在 clang 调用中使用在一个代码中。

The __declspec(dllexport) attribute declares a variable, function, or Objective-C interface to be exported from the module. It is available under the -fdeclspec flag for compatibility with various compilers. The primary use is for COFF object files which explicitly specify what interfaces are available for external use. See the dllexport documentation on MSDN for more information.


在这里找到: dllexport (gnu::dllexport)

关于c++ - Clang 发出有关不受支持的 __declspec 属性的警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50752129/

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