I had the same issue “could not be compiled” and I solved it. Do you still have this problem?
In case yes, some suggestions :
-
Keep UE and Visual closed meanwhile ;
-
Ensure , you’ve installed and configured everything visual needs to works properly with UE as shown in this video https://www.youtube.com/watch?v=HQDskHVw1to ;
-
Ensure , inside editor/project.Target.cs engine’s versions is exactly the one you’re using ;
-
If you wrote already some code in your .h and .cpp , check if pubblic/private classes you’re using , are also declared in yourproject .Build.cs file, in case not add them
EXAMPLE :
PublicDependencyModuleNames.AddRange(new string { “ADD HERE”}); If it’s a public one
- Check if your project’s name inside .h and .cpp is well referenced ;
- Refresh your u.project folder ;
- Re-generate visual studio project files ;
- Re-launch your UE project, rebuild if needed.
- Once inside, update your project.