Building of executable and shared library with cmake, runtimelinker does not find dll

前端 未结 4 1313
梦毁少年i
梦毁少年i 2021-01-04 05:14

I am working with gcc(cygwin), gnu make, windows 7 and cmake.

my cmake testprojekt has the following structure

rootdir
|-- App
|   |-- app.cpp
|   +-         


        
4条回答
  •  生来不讨喜
    2021-01-04 05:43

    A solution I prefer that hasn't really been mentioned, is build your shared-libs into the same directory as your executables. This tends to be a much simpler solution.

    One way to do this with cmake is

    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

    Or you can also set output directories based on build flavours.

    See how do I make cmake output into a 'bin' dir?

提交回复
热议问题