Can't create C++ Project but can create Blueprint Project

Hey all!

So I’ve been working with blueprint projects for a little over a year now, but I’ve yet to dabble in C++ projects. When creating my first C++ project I got an error stating that “The project could not be compiled. Would you like to open it in Visual Studio?”. Which seems to be a somewhat common message from the looks of it. What’s odd to me is that the fatal error I’m getting (fatal error LNK1120) does not seem to match anyone else’s that I’ve been able to find. Here is the full message;

The project could not be compiled. Would you like to open it in Visual Studio?

Running C:/Program Files (x86)/Epic Games/4.14/Engine/Binaries/DotNET/UnrealBuildTool.exe CodeTutorial Development Win64 -project="C:/Users//Documents/Unreal Projects/CodeTutorial/CodeTutorial.uproject" -editorrecompile -progress -noubtmakefiles -NoHotReloadFromIDE
@progress push 5%
Parsing headers for CodeTutorialEditor
  Running UnrealHeaderTool "C:\Users\\Documents\Unreal Projects\CodeTutorial\CodeTutorial.uproject" "C:\Users\\Documents\Unreal Projects\CodeTutorial\Intermediate\Build\Win64\CodeTutorialEditor\Development\CodeTutorialEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for CodeTutorialEditor in 3.757003 seconds
@progress pop
Performing 7 actions (4 in parallel)
[2/7] Resource PCLaunch.rc
[3/7] Resource ModuleVersionResource.rc.inl
PCH.CodeTutorial.h.cpp
CodeTutorialGameModeBase.cpp
CodeTutorial.cpp
CodeTutorial.generated.cpp
[7/7] Link UE4Editor-CodeTutorial.dll
   Creating library C:\Users\\Documents\Unreal Projects\CodeTutorial\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-CodeTutorial.lib and object C:\Users\\Documents\Unreal Projects\CodeTutorial\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-CodeTutorial.exp
CodeTutorialGameModeBase.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl AGameModeBase::SetPause(class APlayerController *,class TBaseDelegate)" (?SetPause@AGameModeBase@@UEAA_NPEAVAPlayerController@@anonymous_user_e71e0d8a?$TBaseDelegate@_N$$$V@@@Z)
CodeTutorial.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl AGameModeBase::SetPause(class APlayerController *,class TBaseDelegate)" (?SetPause@AGameModeBase@@UEAA_NPEAVAPlayerController@@anonymous_user_e71e0d8a?$TBaseDelegate@_N$$$V@@@Z)
C:\Users\\Documents\Unreal Projects\CodeTutorial\Binaries\Win64\UE4Editor-CodeTutorial.dll : fatal error LNK1120: 1 unresolved externals
ERROR: UBT ERROR: Failed to produce item: C:\Users\\Documents\Unreal Projects\CodeTutorial\Binaries\Win64\UE4Editor-CodeTutorial.dll
Total build time: 50.96 seconds

Anyone have any clues as to what’s up?

Thank you in advance!

Hello nspidel.skybox

Is this what you receive upon creating a brand new C++ project? If so, can you ensure that you don’t have any plugins enabled that aren’t on by default? You have two Link errors here, both of them usually dealing with a missing include which shouldn’t be the case in a blank project unless there’s a problem caused by a plugin.

Hi Matthew,

That makes complete sense, I do have a plugin! Though it’s not installed to the engine. Could it still be causing an issue? And if so how to I disable it?

Thank you,
Nicholas

If the plugin is enabled in the project, you should be able to disable it by right-clicking the .uproject file and editing it with a text editor such as Notepad. You should see an entry for the plugin listed with “Enabled : True” underneath it. Change the true to false, save the file and then right-click the .uproject again to Generate Visual Studio Project Files. This will cause it to regenerate the .sln file without including the plugin.

After that completes, try building the project again. You can either just double click the .uproject and it’ll try to build for you or you can open the .sln and choose Build > Build Solution from the top of Visual Studio.

I can’t see anything regarding plugins being enabled in the file;

    {
    	"FileVersion": 3,
    	"EngineAssociation": "4.14",
    	"Category": "",
    	"Description": "",
    	"Modules": [
    		{
    			"Name": "CodeProject",
    			"Type": "Runtime",
    			"LoadingPhase": "Default"
    		}
    	]
    }

Is there anything else that could be causing the link errors?

It looks like the plugin isn’t being included then. The only other thing I can think of immediately, although it usually gives a different error, is that there could be something missing from your Visual Studio 2015 installation itself.

Please navigate to your Control Panel > Programs & Features > Microsoft Visual Studio 2015 > Change. A Visual Studio window should pop up and should give you the option to Modify, Repair, and Uninstall. Select Modify and it should list a number of optional parts that can be installed. Please ensure that “Common Tools for Visual C++ 2015” is selected under Programming Languages > Visual C++. This is not to be confused with the entry labeled just “Common Tools” which is not required.

If that wasn’t already enabled, click Update to apply the changes and try compiling once more.

Visual Studio 2015… See, now, I have 2013. That sounds like something that could be problematic.

That would be the issue. The editor started requiring Visual Studio 2015 to compile when 4.10 released. You can continue to use 2013 by selecting it in your preferences, but 2015 must be installed as the toolchain installed along with it is what must be used to compile the any C++ relating to UE4. 2017 is compatible as well.

You can get any of these versions for free under their Community license on Microsoft’s website, but be sure that the EULA and ToS match what you will be using the software for.

We haven’t heard from you in a while, nspidel.skybox. Are you still experiencing this issue? If so, have you been able to try what I mentioned in my previous comment? What were the results? In the meantime, I’ll be marking this issue as resolved for tracking purposes.

Hello Matthew,

I am having similar issue when I create a C++ Project.

Would it be nice of you to help me solve the problem please?

Here is the link to my question: https://answers.unrealengine.com/questions/543385/new-project-c-compile-failed.html

Thanks,