Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot statically link jsoncpp with my CMake project #1537

Open
mrunix00 opened this issue Jun 6, 2024 · 1 comment
Open

Cannot statically link jsoncpp with my CMake project #1537

mrunix00 opened this issue Jun 6, 2024 · 1 comment

Comments

@mrunix00
Copy link

mrunix00 commented Jun 6, 2024

Describe the bug
When I try to statically link jsoncpp into my project, I get the following error message:

[  3%] Linking CXX executable ../../../../bin/jsontestrunner_exe
/usr/bin/ld: cannot find -ljsoncpp_static: No such file or directory

To Reproduce
Steps to reproduce the behavior:

  1. Add the following to CMakeLists.txt file:
set(BUILD_SHARED_LIBS False)
set(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++ -static")
  1. Run cd build && cmake .. && cmake --build .

Expected behavior
Have a statically linked library

Desktop (please complete the following information):

  • OS: Fedora 40
  • CMake version: 3.28.2
  • Meson version: 1.4.0
  • Ninja version: 1.12.1
@baylesj
Copy link
Contributor

baylesj commented Sep 12, 2024

We haven't had capacity to fix CMake related issues, as you have likely noticed. If you want to submit a patch for review I would be happy to review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants