"Could not be compiled, try rebuilding from source manually", when trying to migrate a project to another platform

Did you try opening your project inside Visual Studio, compile with F5 or Ctrl + F5?

But you said you can generate the Visual Studio Files?

Hi, I started a C++ and Blueprint project a long time ago on Mac OSX, but now I want to also create a Windows distribution, however, every time I try to open it on Windows, it fails at compiling the C++ code, I tried removing the Intermediate, Build, Binaries and Saved folder, also generating the Visual Studio Files, updating Visual Studio, but none of this solved the problem.

Any ideas?

Thanks you very much!

There isn’t any Visual Studio project yet, only an Xcode project, the original project was created using Mac, where it compiles perfectly, the problem comes when moving to windows.

I tried to, but with no success

What happens when you generate them? No error message?

this is what I get:

Running C:/Program Files/Epic Games/UE_4.21/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="" -TargetType=Editor -Progress -NoHotReloadFromIDE
    Performing full C++ include scan (building a new target)
    Creating makefile for [ProjectName]Editor (no existing makefile)
    Using Visual Studio 2017 14.16.27023 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023) and Windows 10.0.15063.0 SDK ().
    @progress push 5%
    Parsing headers for[ProjectName]Editor
      Running UnrealHeaderTool "C:\Users\user\Desktop\test\[ProjectName]r.uproject" "" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
    Reflection code generated for [ProjectName]Editor in 28,2147822 seconds
    @progress pop
    Building 51 actions with 4 processes...

(Starts compiling)

      @progress 'Compiling C++ source code...' 27%
      [14/51] SkillItem.gen.cpp
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\INCLUDE\excpt.h(14): error C2059: Sintax error: 'cadena'
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\INCLUDE\excpt.h(14): error C2334: unnexpected symbols (token)
      \include\10.0.15063.0\shared\windef.h(17): error C2059: Sintax error: 'cadena'

(More errors keep showing)

Then, Compiling fails.

I finally found the solution, here are the steps to follow:

1- Uninstall Visual studio 2015 and earlier versions if using Visual studio 2017, also remove all the outdated components

2- Install Visual studio 2017 components required for UE4

3- If there is any .cpp or .h file using , make sure to define WIN32_LEAN_AND_MEAN beafore including the file

4- Delete intermediate, saved and binary folders and rebuild your project