CMake link shared library on Windows

前端 未结 2 788
刺人心
刺人心 2020-12-03 01:48

There are three files, (m.c,m.h, and **main.c*).

File m.h

// m.h
int m();

File m.c

2条回答
  •  清歌不尽
    2020-12-03 02:22

    Using WINDOWS_EXPORT_ALL_SYMBOLS might help. See an introductory article for details. In short, invoke CMake like this:

    cmake -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE
    

提交回复
热议问题