The project could not be compiled. c++

Problem is this, I tried to create a c++ project with UE 4 and when I tried to create a new project I run this kind of error:


The project could not be compiled. Would you like to open it in Visual Studio?
Running E:/Unreal Engine 4/Epic Games/4.13/Engine/Binaries/DotNET/UnrealBuildTool.exe Puzzle Development Win64 -project=“C:/Users/DevComputer/Documents/Unreal Projects/Puzzle/Puzzle.uproject” -editorrecompile -progress -noubtmakefiles -NoHotReloadFromIDE
@progress push 5%
Parsing headers for PuzzleEditor
Running UnrealHeaderTool “C:\Users\DevComputer\Documents\Unreal Projects\Puzzle\Puzzle.uproject” “C:\Users\DevComputer\Documents\Unreal Projects\Puzzle\Intermediate\Build\Win64\PuzzleEditor\Development\PuzzleEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed

Reflection code generated for PuzzleEditor in 4,8636595 seconds

@progress pop

Performing 11 actions (6 in parallel)

[2/11] Resource PCLaunch.rc

[3/11] Resource ModuleVersionResource.rc.inl

PCH.Puzzle.h.cpp

Puzzle.generated.cpp

PuzzlePawn.cpp

PuzzleBlock.cpp

PuzzleBlockGrid.cpp

PuzzleGameMode.cpp

PuzzlePlayerController.cpp

Puzzle.cpp

[11/11] Link UE4Editor-Puzzle.dll

Creating library C:\Users\DevComputer\Documents\Unreal Projects\Puzzle\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Puzzle.lib and object C:\Users\DevComputer\Documents\Unreal Projects\Puzzle\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Puzzle.exp

Puzzle.cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) public: static class TBaseDelegate & __cdecl FCoreDelegates::GetObjectArrayForDebugVisualizersDelegate(void)” (_imp?GetObjectArrayForDebugVisualizersDelegate@FCoreDelegates@@SAAEAV?$TBaseDelegate@PEAVFFixedUObjectArray@■■■$V@@anonymous_user_9674a66c) referenced in function “void __cdecl `dynamic initializer for ‘GObjectArrayForDebugVisualizers’’(void)” (??__EGObjectArrayForDebugVisualizers@@YAXXZ)
PuzzleGameMode.cpp.obj : error LNK2001: unresolved external symbol “public: virtual bool __cdecl AGameMode::SetPause(class APlayerController *,class TBaseDelegate)”
(?SetPause@AGameMode@@UEAA_NPEAVAPlayerController@@anonymous_user_e71e0d8a1?$TBaseDelegate@_N$$$V@@@Z)
Puzzle.generated.cpp.obj : error LNK2001: unresolved external symbol “public: virtual bool __cdecl AGameMode::SetPause(class APlayerController *,class TBaseDelegate)”
(?SetPause@AGameMode@@UEAA_NPEAVAPlayerController@@anonymous_user_e71e0d8a1?$TBaseDelegate@_N$$$V@@@Z)
PuzzlePlayerController.cpp.obj : error LNK2001: unresolved external symbol “public: virtual bool __cdecl APlayerController::SetPause(bool,class TBaseDelegate)”
(?SetPause@APlayerController@@UEAA_N_NV?$TBaseDelegate@_N$$$V@@@Z)
Puzzle.generated.cpp.obj : error LNK2001: unresolved external symbol “public: virtual bool __cdecl APlayerController::SetPause(bool,class TBaseDelegate)”
(?SetPause@APlayerController@@UEAA_N_NV?$TBaseDelegate@_N$$$V@@@Z)
C:\Users\DevComputer\Documents\Unreal Projects\Puzzle\Binaries\Win64\UE4Editor-Puzzle.dll : fatal error

LNK1120: 3 unresolved externals

ERROR: UBT ERROR: Failed to produce item: C:\Users\DevComputer\Documents\Unreal Projects\Puzzle\Binaries

\Win64\UE4Editor-Puzzle.dll

Total build time: 37,22 seconds


What I have already tried to fix this problem:

  • Run UE 4 editor as administrator →
    not worked
  • Re-Install Visual studio 13 → not
    worked
  • Deleted antivirus software and then
    tried to create new c++ project with
    UE 4 → not worked
  • Added VC++ Directories to puzzle
    solution as in Visual Studio →
    not worked

Blueprint projects worked fine but I want to run a c++ project. Also project was build successfully in Visual Studio, but if I try “Local Windows Debugger” as “Development” it says:

" The following modules are missing or built with a different engine version:
UE4Editor-Puzzle.dll
Would you like to rebuild them now?"

I pressed “Yes”.

Then Visual Studio says:

“Puzzle could not be complied. Try rebuilding from source manually.”

Then I am stuck.

Any help would be nice…

I might be wrong, but it seems the problem is that a couple of files have been generated with a different version of Visual Studio than you currently have installed. Have you tried resetting your project?

To reset your project, go into your Project folder with your file browser. To be safe you should have a backup for the next step. Mostly in case you delete the wrong files. Delete everything in your project folder, except the .uproject file, the Source folder, the Content folder and the Config folder. Now right click the .uproject file and generate visual studio files, compile in Visual Studio, open your project with Unreal and everything should be good to go.

I deleted these files and then tried to build solution but I got lots of errors and warnings. Solution builded just fine before this deleting operation.

Well I managed to fix this problem. The problem was that I had wrong version of Visual Studio. When I Installed VS15 problem was fixed. :slight_smile: