简体   繁体   中英

Linking external library in runtime

I'm to trying compile simple program which uses FMOD with CMake. Compilation seems to be alright but my application crashes with 0xC0000135 which is STATUS_DLL_NOT_FOUND

My CMakeList.txt

cmake_minimum_required(VERSION 3.7)
project(fmod-test)

set(FMOD_DIR "D:/FMOD SoundSystem/FMOD Studio API Windows")
set(CMAKE_CXX_STANDARD 11)

set(SOURCE_FILES main.cpp)

add_executable(fmod-test ${SOURCE_FILES})

include_directories(${FMOD_DIR}/api/lowlevel/inc ${FMOD_DIR}/api/studio/inc)

link_directories("${FMOD_DIR}/api/lowlevel/lib" "${FMOD_DIR}/api/studio/lib")
target_link_libraries(fmod-test
    "${FMOD_DIR}/api/lowlevel/lib/fmod_vc.lib"
    "${FMOD_DIR}/api/studio/lib/fmodstudio_vc.lib")

Is this a problem with my cmake config or environment? Should I put DDLs in some specific place or provide path to them somethere besided CMakeLists.txt?

Solved by adding api/lowlevel/lib and api/studio/lib to the PATH variable.

Kudos to kvr for suggestion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM