devkitPro / wut

Let's try to make a Wii U Toolchain / SDK for creating rpx/rpl.
zlib License
244 stars 52 forks source link

CMAKE_C(XX)_COMPILER is not a full path to an existing compiler tool #64

Closed BtheDestroyer closed 6 years ago

BtheDestroyer commented 6 years ago

My OS: Windows 10 Home Insider Build 17666.rs_prerelease.180504-1501

Repro:

  1. Installed CMake, MinGW, and DevkitPro + DevkitPPC. I already have Visual Studio 15 (2017) but updated it just to be safe.
  2. Ran the following commands from the Readme in my Documents folder (no spaces in the path):
    set DEVKITPPC=<Path to devkitPPC>
    git clone --recursive https://github.com/decaf-emu/wut.git
    cd wut
    mkdir build && cd build
    cmake -DCMAKE_INSTALL_PREFIX=install -G "Visual Studio 15 2017" ../
  3. The next command with msbuild wouldn't work (I recieved the following error) so I just opened wut.sln in VS15, changed Debug to Release and built Install (9 successes, 6 failures). Solved
    
    Microsoft (R) Build Engine version 14.0.25420.1
    Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/13/2018 4:50:00 PM. Project "C:\Users\BtheDestroyer\Documents\WiiUHacking\wut\build\INSTALL.vcxproj" on node 1 (default targets). Project "C:\Users\BtheDestroyer\Documents\WiiUHacking\wut\build\INSTALL.vcxproj" (1) is building "C:\Users\BtheDestroyer \Documents\WiiUHacking\wut\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets). C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build to ols for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\BtheDestroyer\Documents\WiiUHacking\wut\build\ZERO_CHECK .vcxproj] Done Building Project "C:\Users\BtheDestroyer\Documents\WiiUHacking\wut\build\ZERO_CHECK.vcxproj" (default targets) -- F AILED.

Done Building Project "C:\Users\BtheDestroyer\Documents\WiiUHacking\wut\build\INSTALL.vcxproj" (default targets) -- FAIL ED.

Build FAILED.

"C:\Users\BtheDestroyer\Documents\WiiUHacking\wut\build\INSTALL.vcxproj" (default target) (1) -> "C:\Users\BtheDestroyer\Documents\WiiUHacking\wut\build\ZERO_CHECK.vcxproj" (default target) (2) -> (PlatformPrepareForBuild target) -> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 bui ld tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-clic k the solution, and then selecting "Retarget solution". [C:\Users\BtheDestroyer\Documents\WiiUHacking\wut\build\ZERO_CHE CK.vcxproj]

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.54

4. Manually set the environment variable `WUT_ROOT` to `(path to wut clone)/build/install`
5. Restarted cmd so it would pick up on the environment change.
6. `cd`-ed to `(path to wut clone)/samples/`, ran `mkdir build && cd build`
7. Running `cmake -DCMAKE_TOOLCHAIN_FILE=%WUT_ROOT%\cmake\wut-toolchain.cmake -G "Unix Makefiles" ../` resulted in the following error:

-- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:2 (project): The CMAKE_C_COMPILER:

/c/devkitPro/devkitPPC/bin/powerpc-eabi-gcc.exe

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:2 (project): The CMAKE_CXX_COMPILER:

/c/devkitPro/devkitPPC/bin/powerpc-eabi-g++.exe

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!



I've tried manually setting the `CC` and `CXX` environment variables to valid paths (same path, but beginning with `C:` instead of `/c` and using backslashes instead of forward slashes) but get the same error.
I've tried using `-D` to manually set the paths.
I've tried using different generators.
Zarklord commented 6 years ago

You need vs 17 to use WUT In your error report it says its missing build tools v141 which is vs17 where as what you have v140 is vs15

BtheDestroyer commented 6 years ago

Visual Studio 17 doesn't exist. The newest version is Visual Studio 15.7 (also called Visual Studio 2017).

VS Installer Installed components

This is one of the reasons I hate that dev team's naming system - it's never lined up with the year of release.

BtheDestroyer commented 6 years ago

I also just tried installing via WSL and it tried to copy /build/externals/zlib-prefix/src/zlib-build/ to /, so I'm going to try it on a VM instead.

BtheDestroyer commented 6 years ago

I just did some digging in my filesystem and found that msbuild is now buried deep in Program Files. I found the newest version in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin (to make things worse, there's actually multiple msbuild.exes in multiple folders) and after changing my Path to accommodate, here's my new problem (same as the second one): https://pastebin.com/RGkeT54V

I'm running a Windows 10 system, but CMake is trying to use a Unix style drive path (/c/ instead of C:\)

BtheDestroyer commented 6 years ago

I think I've found the issue: System Variables

I think this was caused by me swapping between using WSL and the normal Windows cmd. After correcting the system variables, I cleaned /wut/build and then reran cmake and msbuild. Everything works perfectly.

NOTE: Backslashes MUST be forward slashes, not backslashes (C:/devkitPro not C:\devkitPro). Even though all other system variables aren't, these need to be else cmake will think they're escape characters.

I don't have much experience with cmake, but if it's at all similar to make it shouldn't be hard to check the operating system and then replace /c/ with C:/ if needed. At the very least, now this issue can explain how to solve the problem should anyone else come across it.