Using existing third-party code in Unreal Engine

Hi all,

I’m having a code project which I want to integrate into UE. I tried the initial method: build my project as static library (.lib) and use the build script to add the header files and built library, but this method doesn’t work (if you want more details I can share my folder directory and my build script, but this is not my favorite way).

My question is, can I use my existing code (both header files and source files, without the need to compile it statically) inside Unreal? If I can, how should I modify the build system?

The reason behind my desire to use code rather than binary form is that I want to have it running with my Linux machine.

Thanks in advance,

Any one knows how to solve this? Users/Epic Games staffs?

I would suggest you focus on solving the original problem rather than importing code.

Your approach of importing the libs should work. We do it all the time. The lib needs to be built as static with Multithreaded DLL Release Runtime ( /MD in MSVC14).
It must contain all external symbols unless you link further libs (like Boost for example)

And you MUST insulate your interface for including in Unreal which is the hardest part.

  1. Your headers should not include
    anything else. Possibly not even STL
  2. Live objects should not travel
    inside or outside your lib. What you
    allocate you free.
  3. Make sure when
    using strings (char*) to know it’s
    UTF8 from Unreal’s wchar.

Other than that, this here: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums should be accurate enough.

HTH,
Moose