Lately I’m struggling to include PCL in UE4 project - and I almost done it. For comparison I made clear example project in Qt (without UE) - and what I saw for the first time was clear compiling, and after this error with call for dll’s (VTK libraries). When I set VTK path I was able to run program correctly.
After this I included whole project in UE4 - I created simple AActor class with body of source in the constructor. Project compiled without problem (after ~70 hours of struggling), but:
Constructor doesn’t start properly - I guess because it doesn’t find necessary dll’s and just kills a function
After shutting down Project doesn’t start until I erase whole body of constructor (but includes stays).
Only message I get from Editor was:
"The game module 'TerrainSandbox2' could not be loaded. There may be an operating system error or the module may not be properly set up."
The log file states (after a lot of cuts):
Log file open, 09/09/16 02:20:05
LogInit:Display: Running engine without a game
LogPlatformFile: Not using cached read wrapper
LogInit:Display: Loading recent project file: ../../../../../../UE4 Projects/TerrainSandbox2/TerrainSandbox2.uproject
LogInit:Display: RandInit(1433366134) SRandInit(1433366134).
LogTaskGraph: Started task graph with 5 named threads and 8 total threads with 1 sets of task threads.
LogStats: Stats thread started at 0.083168
[2016.09.09-00.20.39:640][243]LogAssetTools:Warning: Failed to import 'C:\Program Files\VTK 6.3.0\bin\vtkCommonColor-6.1.dll'. Unknown extension 'dll'.
[2016.09.09-00.32.15:806][364]Cmd: QUIT_EDITOR (now there is a lot of closing plugins and modules)
Well, then you are out of luck. For some reason UE4 does not give you access to the GPU drivers so it fails when you try to wrangle the function pointers. As such you can include it, but you cant write any code that uses the GPU. The moment you try it wont start.
I know of no way to fix this and the only way to do this would be to write a program outside of UE4 that communicates with UE4 and sends teh data back and forth.
Hm, not good, but I think the problem lies in not being able to link dll libraries, not the very nature of included library. I had already change the bUseRTTI flag to true.
No, I had the exact same problem that you have and I failed exactly the same way when I tried to launch it after I included OpenGL libraries. The moment I asked for the driver I crashed. That is why the launch stops as you described. There is no way around it as far as I know.
Remove all the code that uses the GPU and it should run fine.
Well, I found complex answer for my problem. The general solution - I still don’t know if importing .dlls were necessary - was to put into config .cs file - here would be called "MyProject.Build.cs - commands to add strings with file paths and filenames for includes, libs and dlls. Commands were:
Et cetera et cetera, I included about 300 different dlls (thank gods for in-shell scripts). My project were working, sometimes were starting, sometimes not, sometimes it were crushing after calling the constructor. Obviously I couldn’t work like that. I found the other solution - my own custom .dll file! It doesn’t requires any imports and libraries once it were compiled. I don’t know what happens if .dll uses CUDA - maybe soon I’ll find out. For now, my problem is solved, and I strongly encourage to learn about dlls any future student.
Hm, now I found that PublicDelayLoadDLL needs to refer into /Binaries/Win64 folder. Because I have only one dll file I just copy it into folder, so I don’t bother looking for refering into another folder.