LNK2019 when including asio headers, solution generated with cmake

前端 未结 4 508
失恋的感觉
失恋的感觉 2021-02-04 12:26

I am trying to port a big project from gcc (Linux) to msvc (windows), using cmake and boost libraries.

The project compile and runs fine for gcc but on msvc it returns t

4条回答
  •  甜味超标
    2021-02-04 13:04

    Looks like, to be linking compatible, binary must have same structure exception handling enablement option. MSVC standard library implementation use structured exception handling option on. Looks like this is why boost::system also uses this on. You might see corresponding warnings telling you to add structure exception handling.

    IF(MSVC)
        ADD_DEFINITIONS("/EHsc")
    ENDIF(MSVC)
    

提交回复
热议问题