Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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,

Product Version: UE Github Master branch
more ▼

asked Oct 11 '16 at 12:57 PM in C++ Programming

avatar image

Tống Tùng Giang
21 2 5

avatar image Tống Tùng Giang Oct 24 '16 at 08:41 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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: https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System should be accurate enough.

HTH, Moose

more ▼

answered Oct 24 '16 at 01:34 PM

avatar image

6 2 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question