drogonframework / drogonframework/drogon

cmake jsoncpp linking error

Open
#2,364 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 13h
Merged PRs (30d)
14

Description

Hi, I have a feeling that jsoncpp library is incorrectly called in a CMakeLists.txt, resulting in a linking errors, the issue being that due to case sensitivity in pkg-config, it is incapable of finding Jsoncpp and linking Jsoncpp_lib.

**To Reproduce**
Steps to reproduce the behavior:
1. Clone the repository
2. mkdir build && cd build && cmake .. && make
3. See error

**Expected behavior**
Code/drogon library links successfully against jsoncpp library

**Environments tested**
1. jsoncpp and jsoncpp-devel installed via dnf
2. jsoncpp compiled from source (checked out to 1.9.6) https://github.com/open-source-parsers/jsoncpp

OS version: Fedora 39, 6.5.6-300.fc39.x86_64
gcc (GCC) 13.3.1 20240913 (Red Hat 13.3.1-3)
cmake version 3.30.5
pkg-config --version 1.9.5

**Additional context**
For me, the fix was rewriting the CMakeLists.txt lines 190 and 191 using lowercase (to jsoncpp and jsoncpp_lib respectively). In case of meeting the same issue, modifying the cmakelists should do the trick, but feel free to ping me.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.