open-source-parsers / open-source-parsers/jsoncpp
"Warning: corrupt .drectve at end of def file" error when building with CMake
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.9k
- Forks
- 2.7k
- Avg merge
- 31m
- Merged PRs (30d)
- 1
Description
Describe the bug
I'm getting a "Warning: corrupt .drectve at end of def file" error at compilation time when trying to build with CMake.
I'm using a fresh install of CLion (obtainable here) on Windows 11.
To Reproduce
Steps to reproduce the behavior (assuming that vcpkg and CLion are correctly installed):
- Create a new project in CLion
- Run
vcpkg integrate install, it will execute and print a statement similar to this one:CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" - Go to File > Settings > Build, Execution, Deployment > Toolchains > CMake and paste the string obtained in the previous step in CMake Options, then apply
- Run
vcpkg install jsoncpp, it will print a statement similar to this one:
jsoncpp provides CMake targets:
# this is heuristically generated, and may not be correct
find_package(jsoncpp CONFIG REQUIRED)
target_link_libraries(main PRIVATE jsoncpp_lib jsoncpp_object JsonCpp::JsonCpp) - Paste those two lines in the
CMakeLists.txtfile inside the project and substitutemainwith the project's name - Run the project and it should stop at compilation time with this error:
Warning: corrupt .drectve at end of def file
Expected behavior
I'm expecting the program to correctly build and run.
Contributor guide
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 by reproducing the build from the reported CMakeLists.txt setup using CLion, vcpkg, jsoncpp, and Windows 11. Check the generated CMake configuration and the point where compilation emits the corrupt .drectve warning. Done means the project builds and runs without that warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100