Hi,
I’ m working with Version 4.6 and try to learn this course: [Converting Blueprint to C++ | Course](https://Converting Blueprints to C++).
In the course they are creating a new C++ class (Object) and change the content to a USTRUCT.
I tried to copy this and I always get some Errors. In Detail, i make the following:
-
Create a new C++ class. In contrary to the tutorial, I can not just right click in the content browser (there is no C++ class):
-
I need to use File or the Folder “C++ classes” - Maybe that is new in 4.26 vs the tutorial… :
-
I create a class (Object Type) like in the tutorial:
-
Then I get a hot-reload Error. This is not happening if I make the same step in a blank C++ Project. Don’t know why…:
This is the Error Code:
CompilerResultsLog: Reflection code generated for BlueprintsToCppEditor in 4,1128458 seconds
CompilerResultsLog: Building BlueprintsToCppEditor…
CompilerResultsLog: Using Visual Studio 2019 14.29.30038 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).
CompilerResultsLog: Building 6 actions with 12 processes…
CompilerResultsLog: [1/6] QuestInfo.cpp
CompilerResultsLog: E:\UnrealEngine\02 Starter Kit Overview\BlueprintsToCpp\Source\BlueprintsToCpp\Quests\QuestInfo.cpp(4): fatal error C1083: Datei (Include) kann nicht ge?ffnet werden: “Quests/QuestInfo.h”: No such file or directory
CompilerResultsLog: [2/6] BlueprintsToCpp.init.gen.cpp
CompilerResultsLog: [3/6] QuestInfo.gen.cpp
LogMainFrame: MainFrame: Module compiling took 13.758 seconds
Warning: HotReload failed, recompile failed
Warning: RebindPackages failed because compilation failed.
LogSlate: Window ‘Message’ being destroyed
Message dialog closed, result: Yes, title: Message, text: Successfully added class ‘QuestInfo’, however you must recompile the ‘BlueprintsToCpp’ module before it will appear in the Content Browser. Failed to automatically hot reload the ‘BlueprintsToCpp’ module.
Would you like to open the Output Log to see more details?
LogSlate: Window ‘Add C++ Class’ being destroyed
LogSlate: Took 0.008408 seconds to synchronously load lazily loaded font ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’ (77K)
-
Next I Reload All in VS:
-
The new created Class:
-
I change it like in the tuorial. This picture is from the tutorial. Later he changes the struct name from “UQuestInfo” to the correct “FQuestInfo”
-
Here is my version:
-
Then I build the solution:
-
Gives me the following errors:
Build started…
1>------ Skipped Build: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
1>Project not selected to build for this solution configuration
2>------ Build started: Project: BlueprintsToCpp, Configuration: Development_Editor x64 ------
2>Building BlueprintsToCppEditor…
2>Using Visual Studio 2019 14.29.30038 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).
2>Building 4 actions with 12 processes…
2> [1/4] QuestInfo.cpp
2>E:\UnrealEngine\02 Starter Kit Overview\BlueprintsToCpp\Source\BlueprintsToCpp\Quests\QuestInfo.cpp(4): fatal error C1083: Cannot open include file: ‘Quests/QuestInfo.h’: No such file or directory
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command ““C:\Program Files\Epic Games\UE_4.26\Engine\Build\BatchFiles\Build.bat” BlueprintsToCppEditor Win64 Development -Project=“E:\UnrealEngine\02 Starter Kit Overview\BlueprintsToCpp\BlueprintsToCpp.uproject” -WaitMutex -FromMsBuild” exited with code 6.
2>Done building project “BlueprintsToCpp.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========
-
It seems for me that the system has some problems with the directory Quests/QuestInfo.h in the QuestInfo.cpp. The directory and include was created by Unreal itself. I did not change anything… But now I tried to change it to:
-
With this directory change i get no more errors:
Build started…
1>------ Skipped Build: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
1>Project not selected to build for this solution configuration
2>------ Build started: Project: BlueprintsToCpp, Configuration: Development_Editor x64 ------
2>Building BlueprintsToCppEditor…
2>Using Visual Studio 2019 14.29.30038 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).
2>Building 4 actions with 12 processes…
2> [1/4] QuestInfo.cpp
2> [2/4] UE4Editor-BlueprintsToCpp-0008.lib
2> Creating library E:\UnrealEngine\02 Starter Kit Overview\BlueprintsToCpp\Intermediate\Build\Win64\UE4Editor\Development\BlueprintsToCpp\UE4Editor-BlueprintsToCpp-0008.lib and object E:\UnrealEngine\02 Starter Kit Overview\BlueprintsToCpp\Intermediate\Build\Win64\UE4Editor\Development\BlueprintsToCpp\UE4Editor-BlueprintsToCpp-0008.exp
2> [3/4] UE4Editor-BlueprintsToCpp-0008.dll
2> Creating library E:\UnrealEngine\02 Starter Kit Overview\BlueprintsToCpp\Intermediate\Build\Win64\UE4Editor\Development\BlueprintsToCpp\UE4Editor-BlueprintsToCpp-0008.suppressed.lib and object E:\UnrealEngine\02 Starter Kit Overview\BlueprintsToCpp\Intermediate\Build\Win64\UE4Editor\Development\BlueprintsToCpp\UE4Editor-BlueprintsToCpp-0008.suppressed.exp
2> [4/4] BlueprintsToCppEditor.target
2>Total time in Parallel executor: 1,83 seconds
2>Total execution time: 2,56 seconds
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========
- But the C++ class is not showing anymore in the Content Browser - even if I recompile or build the solution:
I don’t get this error. I also made a new C++ class project and tried to create a struct by a new C++ class Object and I get some similar errors and finally the C++ class is just not showing anymore in UE4 Content Browser… But it is still in the project folder.
I tried to google the problem and have seen many problems with USTRUCT (UE really makes many problems…), but not the same like mine. Even if I got no problem with the Struct Header, then how can i manually link my header file again? Its still here:
Sorry for the long Post, but like pictures to show really what I’m doing and to make it easier to find the problem.
Edit:
I made a new test and changed the USTRUCT back to a UCLASS:
Recompiled and there is the QuestInfo in the content browser:
So there has to be a problem with the USTRUCT. Please help me, I really don’t know what it could be.
Greeting, Tommy