admin管理员组文章数量:1125037
A proprietary closed-source 3rd-party library which is central to our legacy codebase has define _System
in one of its headers.
This is causing a problem because another library we use () indirectly has dependencies on the Windows concurrency runtime.
Which leads us to concrt.h:
enum _Type
{
/// <summary>
/// Indicates that the location represents the "system location". This has no specific affinity.
/// </summary>
_System, // _M_id is meaningless
/// <summary>
/// Indicates that the location represents a particular NUMA node.
/// </summary>
_NumaNode, // _M_id is the Windows NUMA node number
/// <summary>
/// Indicates that the location represents a particular scheduling node.
/// </summary>
_SchedulingNode, // _M_id is the unique identifier for the scheduling node
/// <summary>
/// Indicates that the location represents a particular execution resource.
/// </summary>
_ExecutionResource, // _M_id is the unique identifier for the execution resource
};
This can't be a totally uncommon problem, are there any obvious workarounds or are we effectively stuck (apart from changing/replacing one of the libraries?)
A proprietary closed-source 3rd-party library which is central to our legacy codebase has define _System
in one of its headers.
This is causing a problem because another library we use (https://github.com/microsoft/cpprestsdk) indirectly has dependencies on the Windows concurrency runtime.
Which leads us to concrt.h:
enum _Type
{
/// <summary>
/// Indicates that the location represents the "system location". This has no specific affinity.
/// </summary>
_System, // _M_id is meaningless
/// <summary>
/// Indicates that the location represents a particular NUMA node.
/// </summary>
_NumaNode, // _M_id is the Windows NUMA node number
/// <summary>
/// Indicates that the location represents a particular scheduling node.
/// </summary>
_SchedulingNode, // _M_id is the unique identifier for the scheduling node
/// <summary>
/// Indicates that the location represents a particular execution resource.
/// </summary>
_ExecutionResource, // _M_id is the unique identifier for the execution resource
};
This can't be a totally uncommon problem, are there any obvious workarounds or are we effectively stuck (apart from changing/replacing one of the libraries?)
Share Improve this question edited 2 days ago 3CxEZiVlQ 37.7k10 gold badges70 silver badges88 bronze badges asked 2 days ago Mr. BoyMr. Boy 63.7k100 gold badges349 silver badges643 bronze badges 4 |1 Answer
Reset to default 1Separation of code a) that's using the 3rd party library b) that's using cpprestsdk into different compilation units should solve the problem.
本文标签: cA 3rd party library defines a symbol clashing with a WinAPI definitionStack Overflow
版权声明:本文标题:c++ - A 3rd party library #defines a symbol clashing with a WinAPI definition - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736642779a1946034.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
#undef
? – Richard Critten Commented 2 days agonamespace
for each library and avoid using macros in public headers(except for compile flow management). Use strict naming conventions. – Red.Wave Commented 2 days ago