Skip to content

Linking issue with Boost libraries from Package Managers (vcpkg) #251

@karlphillip

Description

@karlphillip

I recently had to setup a Windows box for SW development and used vcpkg to install librdkafka and Boost libraries. While building modern-cpp-kafka using the commands below, I ran into a few linking issues on console_clients applications:

set CMAKE_TOOLCHAIN_FILE=C:\Users\Admin\Documents\Workspace\vcpkg\scripts\buildsystems\vcpkg.cmake
cd modern-cpp-kafka
cmake -B build -S . -DCPPKAFKA_ENABLE_TESTS=OFF -A x64
cmake --build build

LINK : fatal error LNK1104: cannot open file 'boost_program_options.lib'

Since CMake now supports imported targets for Boost components (e.g., Boost::program_options), which improves compatibility with package managers like vcpkg and reduces manual configuration, I decided to create a Pull Request to fix this issue for people using package managers:

#250

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions