Skip to content

Does not build as shared library #1845

@antores

Description

@antores

Describe the bug
Drogon does not build shared library because of using thread_local in lib/src/Utilities.cc.

To Reproduce
Build drogon with -DBUILD_SHARED_LIBS:BOOL=ON

Expected behavior
Successful build.

Desktop (please complete the following information):

  • OS: Windows 11
  • MSYS2 CLANG64

Additional context
Errors produced:

xxx/drogon/lib/src/Utilities.cc:1235:46: error: 'hash' cannot be thread local when declared 'dllexport'
 1235 |         thread_local trantor::utils::Hash256 hash;
      |                                              ^
xxx/drogon/lib/src/Utilities.cc:1236:29: error: 'i' cannot be thread local when declared 'dllexport'
 1236 |         thread_local size_t i = 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions