MinGW: file(GET_RUNTIME_DEPENDENCIES ... ERROR: "Failed to run dumpbin/objdump on:"
I am trying to get a hang of the file(GET_RUNTIME_DEPENDENCIES ...
function and read the threads
- Copying dependent DLLs to executable directory?,
- Linux copying dependencies using file(GET_RUNTIME_DEPENDENCIES..) and
- file GET_RUNTIME_DEPENDENCIES - cannot access variables.
I started off with the example project kpyrkosz/cmake_crosscompile given in comment #6 of the thread "file GET_RUNTIME_DEPENDENCIES - cannot access variables".
Running the install
target I get the error:
C:/msys64/mingw64/bin/mingw32-make.exe -f CMakeFiles\Makefile2 preinstall
mingw32-make[1]: Entering directory '<PATH_TO_PROJECT>/cmake_crosscompile/build/eclipse_win_Debug/amd64'
mingw32-make[1]: Nothing to be done for 'preinstall'.
mingw32-make[1]: Leaving directory '<PATH_TO_PROJECT>/cmake_crosscompile/build/eclipse_win_Debug/amd64'
Install the project...
"C:\Program Files\CMake\bin\cmake.exe" -P cmake_install.cmake
-- Install configuration: "Debug"
CMake Error at cmake_install.cmake:41 (file):
file Failed to run dumpbin on:
demonstration
mingw32-make: *** [Makefile:93: install] Error 1
"C:/msys64/mingw64/bin/mingw32-make.exe install" terminated with exit code 2. Build might be incomplete.
I am using MinGW64 and found out I do not have dumpbin
but objdump
in my %PATH%
. The CMAKE_OBJDUMP
variable is correctly set to CMAKE_OBJDUMP="C:/msys64/mingw64/bin/objdump.exe"
, but I still have to manually set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL objdump)
for objdump
to be used instead of dumpbin
. Now I at least get the error file Failed to run objdump on:
[100%] Built target demonstration
mingw32-make[1]: Leaving directory '<PATH_TO_PROJECT>/cmake_crosscompile/build/eclipse_win_Debug/amd64'
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_progress_start D:\Code\Misc\C++\Projects\cmake_crosscompile\build\eclipse_win_Debug\amd64\CMakeFiles 0
C:/msys64/mingw64/bin/mingw32-make.exe -f CMakeFiles\Makefile2 preinstall
mingw32-make[1]: Entering directory '<PATH_TO_PROJECT>/cmake_crosscompile/build/eclipse_win_Debug/amd64'
mingw32-make[1]: Nothing to be done for 'preinstall'.
mingw32-make[1]: Leaving directory '<PATH_TO_PROJECT>/cmake_crosscompile/build/eclipse_win_Debug/amd64'
Install the project...
"C:\Program Files\CMake\bin\cmake.exe" -P cmake_install.cmake
-- Install configuration: "Debug"
CMake Error at cmake_install.cmake:46 (file):
file Failed to run objdump on:
demonstration
mingw32-make: *** [Makefile:93: install] Error 1
"C:/msys64/mingw64/bin/mingw32-make.exe install" terminated with exit code 2. Build might be incomplete.
, which seems more reasonable.
How can I analyze what's wrong?
Edited by Brad King