UE4 Program linking the Engine
Is it possible to link the Engine in a Program?
I've seen that every other program basically has the UEBuildConfiguration.bCompileAgainstEngine = false;. However, I tried it out as true and I've come a long way of adding modules and include paths to my Build.cs, as well as testing out some UEBuildConfiguration values in my Target.cs, until It seemed I was going to get it right, but suddenly I came into the following error:
I don't know how to deal with that unresolved external, I've only found it in the PreInit() function as an extern bool in the LaunchEngineLoop.cpp file, and also in the Launch.cpp file as a bool declared as false. Both those files were in my include paths by default when I started out by copy pasting the BlankProgram provided.
Why I am trying to link the Engine
The main reason for this has to deal with TDD. I'm not really confortable with the testing framework provided by UE, it doesn't fit my workflow at all. So, I thought about using my usual unit testing library within a program, but I obviously need to have the Engine classes referenced.
After overcoming a lot of compilation errors I'm now asking myself whether there is a reason for not linking the Engine in a UE Program. As of TDD, I always have my tests in another project that references the one being tested, and that's usually the way to go for everyone.
How may I correct that error, or what would be the correct way for getting my TDD library into UE as long as I'm able to run its very own executable file?
I'm pretty sure the only way to get an executable console application in UE is within a Program, please prove me wrong if that's not the case.
I was able to solve the above error and it was ofc because of my own misunderstanding of what the extern keyword was. I finally understood it thanks to this stackoverflow post: http://stackoverflow.com/questions/10422034/when-to-use-extern-in-c
The code now compiles with:
I still don't know if it's correct to link the engine against a program. But I finally found the answer I really wanted for Unit Testing with the library I use, thanks to this post by Wolfjagger:
and the forum link he provided with his solution:
answered Oct 11 '15 at 10:56 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here