Hey,
To put it simply, I’ve created a new project named the same as my exisiting one, a C++ 2D side scroller, and coppied the Source folder from my exisiting project into the new one. I know all the code comiples fine but when I try and build from the .uproject or inside Visual Studio it fails due to:
2>Module.Test2D.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl UUserWidget::UUserWidget(class FObjectInitializer const &)" (__imp_??0UUserWidget@@QEAA@AEBVFObjectInitializer@@@Z) referenced in function "public: __cdecl UAbilityBar::UAbilityBar(class FObjectInitializer const &)" (??0UAbilityBar@@QEAA@AEBVFObjectInitializer@@@Z)
2>Module.Test2D.gen.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl UUserWidget::UUserWidget(class FObjectInitializer const &)" (__imp_??0UUserWidget@@QEAA@AEBVFObjectInitializer@@@Z)
2>Module.Test2D.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl UUserWidget::AddToViewport(int)" (__imp_?AddToViewport@UUserWidget@@QEAAXH@Z) referenced in function "public: virtual void __cdecl ATest2DPlayerController::BeginPlay(void)" (?BeginPlay@ATest2DPlayerController@@UEAAXXZ)
2>Module.Test2D.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl UUserWidget::SetOwningPlayer(class APlayerController *)" (__imp_?SetOwningPlayer@UUserWidget@@QEAAXPEAVAPlayerController@@@Z) referenced in function "public: void __cdecl ATest2DCharacter::SpawnWidgets(void)" (?SpawnWidgets@ATest2DCharacter@@QEAAXXZ)
2>Module.Test2D.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class UUserWidget * __cdecl UUserWidget::CreateWidgetOfClass(class UClass *,class UGameInstance *,class UWorld *,class APlayerController *)" (__imp_?CreateWidgetOfClass@UUserWidget@@SAPEAV1@PEAVUClass@@PEAVUGameInstance@@PEAVUWorld@@PEAVAPlayerController@@@Z) referenced in function "class UBasicHUD * __cdecl CreateWidget<class UBasicHUD>(class APlayerController *,class UClass *)" (??
I’ve tried using Generate VS Files from the .uproject, cleaning, updating the engine, updating VS 2017. But my old project still works.
I’m Using UE 17.1 and VS 2017.