open-source-parsers / open-source-parsers/jsoncpp

"Warning: corrupt .drectve at end of def file" error when building with CMake

Open
#1,430 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug build
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):

  1. Create a new project in CLion
  2. 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"
  3. Go to File > Settings > Build, Execution, Deployment > Toolchains > CMake and paste the string obtained in the previous step in CMake Options, then apply
  4. 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)
  5. Paste those two lines in the CMakeLists.txt file inside the project and substitute main with the project's name
  6. 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

Open the contributing guide

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.