Skip to content

Linker error when using boost.program_options #1

@Vertexwahn

Description

@Vertexwahn

When depending on boost.program_options I get a linker error.

ERROR: /home/vertexwahn/BazelDemos/intermediate/cpp/Boost/ProgramOptions/BUILD.bazel:1:10: Linking demo failed: (Exit 1): gcc failed: error executing command (from target //:demo) /usr/bin/gcc @bazel-out/k8-fastbuild/bin/demo-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
bazel-out/k8-fastbuild/bin/_objs/demo/main.pic.o:main.cpp:function main: error: undefined reference to 'boost::program_options::options_description::m_default_line_length'
bazel-out/k8-fastbuild/bin/_objs/demo/main.pic.o:main.cpp:function main: error: undefined reference to 'boost::program_options::options_description::m_default_line_length'
...

How to reproduce?

git clone https://github.com/Vertexwahn/BazelDemos.git
cd BazelDemos/intermediate/cpp/Boost/ProgramOptions
bazel build //...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions