Static data members in LIBZIM_API and/or LIBZIM_PRIVATE_API classes result in linker errors under Windows CI
Open
Nobody has claimed this yet.
enhancement
task
- Dominant language
- C++
- Stars
- 256
- Forks
- 75
- Avg merge
- 8d 51m
- Merged PRs (30d)
- 4
Description
Examples:
- https://github.com/openzim/libzim/actions/runs/14819235224/job/41603865419?pr=984
- https://github.com/openzim/libzim/pull/958/commits/3dd1a5b86154331cbf46b1c538439287274fc603
The problem seems to be caused by the improper definition of the LIBZIM_API and LIBZIM_PRIVATE_API macros.
- When building a DLL they need to be defined as
__declspec(dllexport) - However when compiling client code to be linked with a DLL they must be set to
__declspec(dllimport)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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