How to build Unreal C++ project on KDevelop on LInux? - c++

I have been unsuccessfully trying to compile a c++/blueprint project using Plugins like SocketIO-for-UE or VA-REST. And now that i realize any C++ fails. creating C++ in Source folder also leads to the same error.
Cannot even start a new C++ Project. It Fails to compile and ask me to build through an IDE.
Starts with:
"Rebuild Now" gives:
I tried few approaches but nothing seems to work.
GenerateProjectFiles.sh /path/to/.uproject
the above generated a Makefile in the project root, Having that imported to Kdevelop, build seems to work fine but doesn't seem to compile or do any thing with the Plugins folder.
Any help would be much appreciated and will generate lot of good karma for you.
I'm Using:
UE4 4.26.1 (Crashes regularly) & 4.26.2
Ubuntu 20
Kdevelop 5.5

Related

How to build&run Unreal C++ project on Linux?

I'm trying to build my first Unreal C++ project on Linux.
I built the engine from source in accordance with "Linux Quick Start" guide. Then I installed Qt Creator and followed the "How to Set up Qt Creator for UE4" guide.
I successfully set up and ran UE4Editor, and created a new C++ project. Unfortunately when I try running the project it complains:
And when I press "yes" this error message is shown:
Here's the error message from the logs:
ERROR: Building would modify the following engine files:
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/Android/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Plugins/2D/Paper2D/Binaries/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Plugins/AI/AISupport/Binaries/Linux/UE4Editor.modules
... many more
I tried rebuilding UE4 from IDE, then building again - but the error still persists. Same thing happens if I try starting UE4Editor from the engine files and opening the project from there.
What could cause this error? Why does it even try to rebuild the engine when I'm tring run a project?
I have the following script to add the paths to the engine scripts and binaries to my PATH:
UNREAL_HOME="/path/to/source/of/UnrealEngine"
UNREAL_SCRIPTS="${UNREAL_HOME}/Engine/Build/BatchFiles"
UNREAL_SCRIPTS_LINUX="${UNREAL_HOME}/Engine/Build/BatchFiles/Linux"
UNREAL_BINS="${UNREAL_HOME}/Engine/Binaries/Linux"
PATH="${PATH}:${UNREAL_BINS}:${UNREAL_SCRIPTS}:${UNREAL_SCRIPTS_LINUX}"
export PATH
Then I run UE4Editor '/absolute/path/to/project.uproject' from within the directory of my project.
I never create a project inside the source tree of the engine. Paths should absolutely be different.
I use VS-Code as the IDE. This is what works best from my experience. QT-Creator will work only if you create an include files with lots of #define that are missing from the .pro files created by unreal.
You can configure VS-Code to have an intelli-sense like completion by installing the C# and C/C++ extensions. I had to install mono in order to get OmniSharp working (this is the server than handles the autocompletion for VS-Code). Here is an extract of my VS-Code settings.json file:
"omnisharp.path": "/home/myuser/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/OmniSharp.exe",
"omnisharp.monoPath": "/usr/bin/mono",
You can also install the C++ Helper extensions which is usefull for creating methods, classes, and so on.
In the directory of your project run 'make YOURPROJECTNAMEEditor', then you can run 'open YOURPROJECTNAME.uproject' and it should open.

VSCode c++ configuring for vc toolchain

I'm trying to start a work in vscode , latest C++ plugin version supports ms debugger, so as I'm mostly working under windows it was a signal to try this.
c++ tools plugin from MS and cmake tools were installed.
my test project was however not built . the problem is clear , but I need an advice from experienced vscode users how to solve this right.
cmake doesn't see vc compiler.
(after using QtCreator) I expected that vscode could detect vc installation... however that's not so. ok, I have a two ways:
fill environment variables INCLUDE/LIB/PATH with a headers, libs and binaries
just run vcvarsall.bat x64
Second way is a simple and reliable. so final question is:
how to run .bat at the begining of vscode start?
(I don't mean write another bat/cmd, prepare the environment and run vscode inside the same script after that)
Although the question is fairly old, I'll try to give a useful answer, in case others stumble across, just like I did.
I believe what you are trying to achieve is not possible. Code inherits the environment it was started with. If you did not launch it from a developer command prompt, you will not be able build and debug. (Building might be possible if every task first starts the vcvarsall.bat, but that slows things down by a lot. Debugging I think will still not work.)
If you are willing to, you can check out vector-of-bools CMake Tools extension which does build automation as well as automatic MSVC detection. It builds using CMake (thus you need to write your build scripts using CMake), but it will take care of building just by pressing F7, like what most VS users are familiar with.

How can I fix Xcode's Build & Analyze?

After installing Xcode 6, my Xcode 5 seems to have stopped performing static analysis on my main app target. I can run Build & Analyze and it turns up static analysis issues in sub projects, but not my main target.
I've tried reinstalling Xcode 5, but it has not helped. I have also tried installing the clang-checker separately and following the instructions for incorporating it into Xcode. After installing the clang-checker I'm seeing analysis for some of the files in my app target, but not all of them. It looks like any C++ or Objective-C++ files in my project are not being analyzed.
If I run scan-build from the command line to try to analyze my project outside of Xcode, I get "analyzer issues" with all of the .mm files.
Has anybody got any suggestions for fixes for this behavior? Thanks!

using gtest with xcode

I'm trying to set up a c++ unit testing library on my computer and figured that google's gtest would be a good fit.
I am currently running mountain lion with the most recent release of xcode.
I have been attempting to follow the instructions found here but am running into an intresting problem.
I am opening the gtest project, building it, and even though xcode tells me that the build was successful, I cant seem to find the framework anywhere. any help on this subject would be highly appreciated!
Thank you!
This worked for me:
Get the code from https://github.com/dmonopoly/gtest-cmake-example
Run the cmake GUI in the usual way (I used version 3.0.0). Hit "Configure", one of the prompts allows you to choose XCode generation. Hit configure again, Enable the "test" config option, hit configure again (and maybe even once again), then hit "Generate".
You should now be able to find the XCode project in the build directory that you specified. Open that project, and you will find the gtest source code, some demo test code, as well as a target for running the tests.

Getting Started with Eclipse CDT

I have downloaded the latest Eclipse CDT release (Helios) and wanted to try my luck with some C++ programming (haven't done that in ages).
I tried to do the "Hello World" project, but I got stuck quite fast.
First thing - the #include <stdio.h> and #include <stdlib.h> got marked with an 'Unresolved Symbol' warning. So I found the place where I can add include paths and pointed it to these headers from the Visual Studio installation I have.
After that, it looked fine but:
I don't see compilation errors/warnings in the Problems tab.
I cannot run the code - I get 'Launch failed. Binary not found' error
My question is simple - what are the steps I really need to do to get my code compiled, linked and executed?
I tried looking for it on Eclipse's site, but didn't find any reference to that.
I'm making a guess here, that your are running on Windows, because that particular error seems to be a windows related one.
You seem to be missing the basic toolchain needed by the CDT to actually build the project. You need some files Before You Get Started. I suggest the mingw installer, as it is simple, and lets you actually build Windows compatible binaries.
Check out the link above, and then make sure your project links to the toolchain. Hope that helps.
A starting point could be:
File -> New -> c++ project
Type a name for the project, select Hello World c++ Project under Project Type and click Finish.
Right click on the project -> Run As -> Local C++ application (or just click the Run button on the toolbar).
I was getting the same error until I ran the "Build All" command. That command created two new folders, Debug and Release. Then when I clicked the "Debug" button, it asked me which one I wanted to run and I selected "Debug" and it ran perfectly.
It seems like the binary it couldn't find was created from the "Build All" command.