openzim / openzim/libzim

Static data members in LIBZIM_API and/or LIBZIM_PRIVATE_API classes result in linker errors under Windows CI

Open
#985 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement task
Dominant language
C++
Stars
256
Forks
75
Avg merge
8d 51m
Merged PRs (30d)
4

Description

Examples:

The problem seems to be caused by the improper definition of the LIBZIM_API and LIBZIM_PRIVATE_API macros.

  1. When building a DLL they need to be defined as __declspec(dllexport)
  2. However when compiling client code to be linked with a DLL they must be set to __declspec(dllimport)

See https://learn.microsoft.com/en-us/cpp/build/importing-into-an-application-using-declspec-dllimport?view=msvc-170

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the LIBZIM_API and LIBZIM_PRIVATE_API definitions and the linked Windows CI failure, then compare their use when building the DLL versus compiling client code. Check the referenced pull request commit for the static data members involved. Done means the Windows CI linker errors are resolved for both DLL builds and clients.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.