0

I'm cross compiling boost::program_options on Linux for Windows using CMake. In CMake I specified

set(Boost_LIBRARIES /usr/local/win64/lib/libboost_program_options.dll)
set(Boost_INCLUDE_DIR /usr/local/win64/incldue)
include_directories(${Boost_INCLUDE_DIR})
target_link_libraries(main.exe -static-libstdc++ -static-libgcc ${Boost_LIBRARIES})

The generated .exe file runs OK on Windows when the first line uses static boost, i.e. libboost_program_options.a. However, when I want to use dynamic boost (in the above code), running the exe on Windows reports missing libgcc_s_seh-1.dll. Why is it looking for it anyway?

Xiangcai
  • 11
  • 4

1 Answers1

0

The generated .exe file runs OK on Windows when the first line uses static boost, i.e. libboost_program_options.a. However, when I want to use dynamic boost (in the above code), running the exe on Windows reports missing libgcc_s_seh-1.dll. Why is it looking for it anyway?

You've implicitly answered your own question, here: libgcc_s_seh-1.dll is a GCC runtime DLL. Dynamic boost wasn't compiled with -static-libstdc++ -static-libgcc, so it depends on libgcc_s_seh-1.dll. You will have to recompile dynamic boost with these flags.

Alex Reinking
  • 16,724
  • 5
  • 52
  • 86