Troubleshooting

This section contains commonly encountered problems when compiling or using HPX.

Undefined reference to boost::program_options

Boost.ProgramOptions is not ABI compatible between all C++ versions and compilers. Because of this you may see linker errors similar to this:

...: undefined reference to `boost::program_options::operator<<(std::ostream&, boost::program_options::options_description const&)'

if you are not linking to a compatible version of Boost.ProgramOptions. We recommend that you use hpx::program_options, which is part of HPX, as a replacement for boost::program_options (see program_options). Until you have migrated to use hpx::program_options we recommend that you always build Boost libraries and HPX with the same compiler and C++ standard.

Undefined reference to hpx::cout

You may see an linker error message that looks a bit like this:

hello_world.cpp:(.text+0x5aa): undefined reference to `hpx::cout'
hello_world.cpp:(.text+0x5c3): undefined reference to `hpx::iostreams::flush'

This usually happens if you are trying to use HPX iostreams functionality such as hpx::cout but are not linking against it. The iostreams functionality is not part of the core HPX library, and must be linked to explicitly. Typically this can be solved by adding COMPONENT_DEPENDENCIES iostreams to a call to add_hpx_library/add_hpx_executable/hpx_setup_target if using CMake. See Creating HPX projects for more details.