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?