Project could not be compiled try rebuilding from source manually

Hello
After i updated my visual studio i tried to create a c++ file in ue4 and it failed, so i tried deleting .vs, saved, Intermidate etc and the .sln file multiple times and rebuilding. But it keeps falling, the log says something about UPhysicalMaterial and SurfaceType but i dont get any errors in the code so i have no idea how to fix it.

This is the log from saved folder:

E4Editor-Project_X.lib
Creating library E:\Unreal Projects\Project X\Intermediate\Build\Win64\UE4Editor\Development\Project_X\UE4Editor-Project_X.lib and object E:\Unreal Projects\Project X\Intermediate\Build\Win64\UE4Editor\Development\Project_X\UE4Editor-Project_X.exp
@progress ‘Compiling C++ source code…’ 97%
[28/29] UE4Editor-Project_X.dll
Creating library E:\Unreal Projects\Project X\Intermediate\Build\Win64\UE4Editor\Development\Project_X\UE4Editor-Project_X.suppressed.lib and object E:\Unreal Projects\Project X\Intermediate\Build\Win64\UE4Editor\Development\Project_X\UE4Editor-Project_X.suppressed.exp
Project_XWeapon.cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) public: static enum EPhysicalSurface __cdecl UPhysicalMaterial::DetermineSurfaceType(class UPhysicalMaterial const *)” (_imp?DetermineSurfaceType@UPhysicalMaterial@@SA?AW4EPhysicalSurface@@PEBV1@@Z) referenced in function “public: void __cdecl AProject_XWeapon::Attack(void)” (?Attack@AProject_XWeapon@@QEAAXXZ)
E:\Unreal Projects\Project X\Binaries\Win64\UE4Editor-Project_X.dll : fatal error LNK1120: 1 unresolved externals
LogInit: Warning: Still incompatible or missing module: Project_X
LogCore: Engine exit requested (reason: EngineExit() was called)
LogExit: Preparing to exit.

My ProjectXWeapon cpp file


Try to clean your project. You find it under Build in top bar in visual studio.

Hello, i have tried this :smiley:

I have commented out the phsicalsurface/surfacetype code and i can now succesfully rebuild the project. What is wrong with the code? I still dont get any code errors.

The docs for that

Say that is within the PhysicsCore module, so you would need to add that to your Build.cs file that’s within your project’s Source folder.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms