Closed 130s closed 1 year ago
Via https://gamedev.stackexchange.com/a/192114/172669, I noticed "Compiler Path" for the prj on VSCode is set to something like ~/pg/unreal-engine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v21_clang-15.0.1-centos7
, while in the same pulldown menu I see a bunch of other, simpler path e.g. /usr/bin/{clang, gcc, g++}
. Switching it to clang
didn't take an effect.
Following https://stackoverflow.com/a/75427874/577001, I did on UE5 "tools -> refresh visual studio code project", then "Run Build Task" on VSC, then VSC asked me to choose the type of job where I selected something like %PRJ_NAME%/DEBUG build
, then I now got a different the error msg.
* Executing task in folder eg_cpp_mooc: Engine/Build/BatchFiles/Linux/Build.sh eg_cpp_mooc Linux Debug /home/onyanko-hanakuso/unreal_prjs/eg_cpp_mooc/eg_cpp_mooc.uproject -waitmutex
Setting up bundled DotNet SDK
Running command : dotnet Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll eg_cpp_mooc Linux Debug /home/onyanko-hanakuso/unreal_prjs/eg_cpp_mooc/eg_cpp_mooc.uproject -waitmutex
Log file: /home/n130s/.config/Epic/UnrealBuildTool/Log.txt
Using 'git status' to determine working set for adaptive non-unity build (/home/onyanko-hanakuso/unreal_prjs/eg_cpp_mooc).
Creating makefile for eg_cpp_mooc (no existing makefile)
Targets cannot be built in the Debug configuration with this engine distribution.
* The terminal process "/usr/bin/bash '-c', 'Engine/Build/BatchFiles/Linux/Build.sh eg_cpp_mooc Linux Debug /home/onyanko-hanakuso/unreal_prjs/eg_cpp_mooc/eg_cpp_mooc.uproject -waitmutex'" terminated with exit code: 6.
* Terminal will be reused by tasks, press any key to close it.
So instead, I re-ran and now chose %PRJ_NAME%/DEBUGGAME build
, the compilation seems to be proceeding.
Following https://stackoverflow.com/a/75427874/577001, I did on UE5 "tools -> refresh visual studio code project", then "Run Build Task" on VSC, then VSC asked me to choose the type of job where I selected something like
%PRJ_NAME%/DEBUG build
, then I now got a different the error msg.
This might have reset the project setting I previously made? Anyways include path
is now empty again. So adding there: /home/onyanko/pg/unreal-engine/Engine/Source/Runtime/Core/Public
Having no idea, I'm just re-creating a project.
Following https://medium.com/@ricardoemiranda/compiling-a-c-project-in-unreal-engine-5-0-971a1b07af20,
Development Build
. No obvious error shown on VSC's terminal.Unreal Engine 4 Snippets
even though the website recommends, as it uses v4 (even though the website is about UE5 + VSC) while my UE is v5.Then, back to UEditor, I dragged the PrintMessage obj (?) onto the main pane then clicked "Play" button (light green), then UE crashed again (I saw core dump).
Anyways, the build error might be gone? Closing for now though I'm not 100% sure yet.
On VSC, installing "Unreal Engine 4 Snippets" (though it mentions UE4, not UE5). That is what was mentioned in https://github.com/kinu-garage/hut_10sqft/issues/858#issuecomment-1624246948 (rebooted VSC after intalling it) didn't seem to take an effect.
Oh btw I see this.
[7/11/2023, 12:12:08 PM] "PrintMessage.cpp" not found in "/home/noodler/unreal_prjs/eg_mooc_cpp5/.vscode/compileCommands_Default.json". 'includePath' from c_cpp_properties.json in folder 'eg_mooc_cpp5' will be used for this file instead.
But I don't see includePath
defined anywhere in the workspace on VSC's config.
$ ack -ir includePath .vscode/
$
I then randomly ran into https://gist.github.com/pShota/439bc7a0dd3c726d1d5750856fb88cd8
Setup Unreal Engine 4.25 with Visual Studio Code
Normally you would use Visual Studio 2019 with UE4, but VS 2019 is somewhat "heavy", where Visual Studio Code is a decent alternative. However some fixes are needed before you can use it.
Step 1
First, you need to change Editor to VS Code in Unreal Engine Setting, after that you press generate VS Code project in UE4 menu. Modify file .vscode/c_cpp_properties.json from your project folder, it should look like this:
{ "configurations": [ { "name": "UnrealEngine", "includePath": [ "/Users/Shared/Epic Games/UE_4.25/Engine/Source", "/Users/Shared/Epic Games/UE_4.25/Engine/Source/Runtime", ..............(a lot of paths).............. "/usr/local/include" ], "intelliSenseMode": "clang-x64", "macFrameworkPath": [ "/System/Library/Frameworks", "/Library/Frameworks" ], "defines":[ ], "compilerPath": "/usr/bin/clang", "cStandard": "c11", "cppStandard": "c++17" } ], "version": 4 }
I don't see in my conf configurations
section for UE at all. Manually adding.
The referencing error on VSC went away!
Playing the level on UE doesn't seem to take a new effect. Moving on to step-2 and further in https://gist.github.com/pShota/439bc7a0dd3c726d1d5750856fb88cd8
On UE I'm seeing this so at least the actor is added on UE, but I still don't see the intended print msg.
:
Cmd: DELETE
Cmd: ACTOR DELETE
LogEditorActor: Deleted Actor: PrintMessage
LogUObjectHash: Compacting FUObjectHashTables data took 0.73ms
LogEditorActor: Deleted 1 Actors (0.027 secs)
LogEditor: Attempting to add actor of class 'PrintMessage' to level at 70.00,150.00,0.00
LogPackageName: Warning: DoesPackageExist called on PackageName that will always return false. Reason: Input '' was empty.
LogEditor: Attempting to add actor of class 'PrintMessage' to level at -370.00,-570.00,0.00
:
For now closing this, and move on to look into other errors/warnings that are seen on UEditor.
Occurred during https://github.com/kinu-garage/essay_in_idleness/issues/6
Building the 1st sample prj fails when referring to a header in Unreal's library:
C++ from [here](https://www.coursera.org/learn/introductionprogrammingunreal/supplement/d4Nc9/exercise-2-writing-your-first-unreal-script): ``` Starting build... /usr/bin/g++ -fdiagnostics-color=always -g /home/onyanko-hanakuso/unreal_prjs/eg_cpp_mooc/Source/eg_cpp_mooc/PrintMessage.cpp -o /home/onyanko-hanakuso/unreal_prjs/eg_cpp_mooc/Source/eg_cpp_mooc/PrintMessage In file included from /home/onyanko-hanakuso/unreal_prjs/eg_cpp_mooc/Source/eg_cpp_mooc/PrintMessage.cpp:4: /home/onyanko-hanakuso/unreal_prjs/eg_cpp_mooc/Source/eg_cpp_mooc/PrintMessage.h:5:10: fatal error: CoreMinimal.h: No such file or directory 5 | #include "CoreMinimal.h" | ^~~~~~~~~~~~~~~ compilation terminated. Build finished with error(s). * The terminal process failed to launch (exit code: -1). * Terminal will be reused by tasks, press any key to close it. ``` Not sure if this is related but when I just opened the workspace by switching from another workspace, I got: ``` "PrintMessage.cpp" not found in "/home/xxxxx/eg_cpp_mooc/.vscode/compileCommands_Default.json". 'includePath' from c_cpp_properties.json in folder 'eg_cpp_mooc' will be used for this file instead. ```