Emulator Issues #12224
closedDolphin fails to build with CMake on Windows
0%
Description
What's the problem? Describe what went wrong.
Dolphin fails to build due to warnings.
What steps will reproduce the problem?
Build Dolphin with the Qt submodule using CMake, as described at https://github.com/dolphin-emu/dolphin/wiki/Building-for-Windows. (Do not use a custom install of Qt.)
If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)
5.0-12462
What are your PC specifications? (CPU, GPU, Operating System, more)
Windows 10, Visual Studio 16.5.4
Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)
There are two parts to the build failure. The first part is deprecation warnings which are fixed in https://github.com/dolphin-emu/dolphin/pull/9037. The second part (which I don't know how to fix) has the following log message:
[1248/1248] Linking CXX executable ..\..\Binary\Dolphin.exe
FAILED: ../../Binary/Dolphin.exe
cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=Source\Core\DolphinQt\CMakeFiles\dolphin-emu.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests ..\..\Source\Core\DolphinQt\DolphinQt.manifest -- C:\PROGRA~2\MICROS~4\2019\ENTERP~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\dolphin-emu.rsp /out:..\..\Binary\Dolphin.exe /implib:Source\Core\DolphinQt\Dolphin.lib /pdb:..\..\Binary\Dolphin.pdb /version:0.0 /machine:x64 /NXCOMPAT /INCREMENTAL:NO /subsystem:windows /Brepro && cmd.exe /C "cd /D C:\Users\Jos\Desktop\Dolphin\Dolphin\Build\Release\Source\Core\DolphinQt && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E copy_directory C:/Users/Jos/Desktop/Dolphin/Dolphin/Data/Sys C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary/Sys && cd /D C:\Users\Jos\Desktop\Dolphin\Dolphin\Build\Release\Source\Core\DolphinQt && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E copy_if_different C:/Users/Jos/Desktop/Dolphin/Dolphin/Source/Core/DolphinQt/qt.conf.win C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary/qt.conf && cd /D C:\Users\Jos\Desktop\Dolphin\Dolphin\Build\Release\Source\Core\DolphinQt && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E env PATH="C:/Users/Jos/Desktop/Dolphin/Dolphin/Externals/Qt/Qt5.15.0/msvc2019_64/bin" C:/Users/Jos/Desktop/Dolphin/Dolphin/Externals/Qt/Qt5.14.1/msvc2019_64/bin/windeployqt.exe --libdir="C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary" --plugindir="C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary/QtPlugins" --release --no-translations --no-compiler-runtime C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary/Dolphin.exe""
Creating library Source\Core\DolphinQt\Dolphin.lib and object Source\Core\DolphinQt\Dolphin.exp
C:\Users\Jos\Desktop\Dolphin\Dolphin\Build\Release\LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
Det går inte att hitta filen
ninja: build stopped: subcommand failed.
Updated by AdmiralCurtiss over 3 years ago
For me this doesn't result in an error, just a warning, but either way...
I think what's happening here is that our ffmpeg libraries (https://github.com/dolphin-emu/dolphin/tree/master/Externals/ffmpeg/lib) are built against the static C runtime (/MT
), while the rest of dolphin builds against the dynamic C runtime (/MD
). This isn't noticeable when using the VS project because:
https://github.com/dolphin-emu/dolphin/blob/master/Source/VSProps/Base.props#L175-L176
Updated by JosJuice over 3 years ago
I've gotten rid of the warning by adding add_link_options(/NODEFAULTLIB:libcmt), but it still doesn't build:
[2/2] Linking CXX executable ..\..\Binary\Dolphin.exe
FAILED: ../../Binary/Dolphin.exe
cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=Source\Core\DolphinQt\CMakeFiles\dolphin-emu.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests ..\..\Source\Core\DolphinQt\DolphinQt.manifest -- C:\PROGRA~2\MICROS~4\2019\ENTERP~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\dolphin-emu.rsp /out:..\..\Binary\Dolphin.exe /implib:Source\Core\DolphinQt\Dolphin.lib /pdb:..\..\Binary\Dolphin.pdb /version:0.0 /machine:x64 /NXCOMPAT /INCREMENTAL:NO /subsystem:windows /Brepro /NODEFAULTLIB:libcmt && cmd.exe /C "cd /D C:\Users\Jos\Desktop\Dolphin\Dolphin\Build\Release\Source\Core\DolphinQt && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E copy_directory C:/Users/Jos/Desktop/Dolphin/Dolphin/Data/Sys C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary/Sys && cd /D C:\Users\Jos\Desktop\Dolphin\Dolphin\Build\Release\Source\Core\DolphinQt && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E copy_if_different C:/Users/Jos/Desktop/Dolphin/Dolphin/Source/Core/DolphinQt/qt.conf.win C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary/qt.conf && cd /D C:\Users\Jos\Desktop\Dolphin\Dolphin\Build\Release\Source\Core\DolphinQt && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E env PATH="C:/Users/Jos/Desktop/Dolphin/Dolphin/Externals/Qt/Qt5.15.0/msvc2019_64/bin" C:/Users/Jos/Desktop/Dolphin/Dolphin/Externals/Qt/Qt5.14.1/msvc2019_64/bin/windeployqt.exe --libdir="C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary" --plugindir="C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary/QtPlugins" --release --no-translations --no-compiler-runtime C:/Users/Jos/Desktop/Dolphin/Dolphin/Binary/Dolphin.exe""
Creating library Source\Core\DolphinQt\Dolphin.lib and object Source\Core\DolphinQt\Dolphin.exp
Det går inte att hitta filen
ninja: build stopped: subcommand failed.
I am not certain that this issue was caused by 5.0-12462, unlike the deprecation issues. I will have to do some more testing.
Updated by JosJuice over 3 years ago
After looking closer at the one line of the build log that's really long, it seems like the build process is trying to access C:/Users/Jos/Desktop/Dolphin/Dolphin/Externals/Qt/Qt5.14.1/msvc2019_64/bin/windeployqt.exe, which would explain why it complains about not being able to find some file. Perhaps I just have the old path cached somehow?
Updated by JosJuice over 3 years ago
- Status changed from New to Fix pending
It works after clearing the CMake cache, so strike the second part of the issue. Only the deprecation warnings are a valid part of the issue, and they are fixed in https://github.com/dolphin-emu/dolphin/pull/9037.
Updated by JosJuice over 3 years ago
- Status changed from Fix pending to Fixed
- Fixed in set to 5.0-12509