jsoncpp icon indicating copy to clipboard operation
jsoncpp copied to clipboard

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

Open retr00h opened this issue 3 years ago • 0 comments

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.

retr00h avatar Aug 19 '22 12:08 retr00h