x

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"

how to import dll function in unreal

hello guys i am unity programmer and these learning amazing unreal. and recently have got trouble with the way of calling dll function. in the unity, you make the script that defines the functions that have same name with dll function. i expected it would be similar in unreal but i haven't really found the actual way like that similar. so just hope it's my simple mistake.

this is my dll file. alt text

so what i want is to use that functions from dll in unreal either blueprint or c++. any advice would be thanksful.

Product Version: UE 4.20
Tags:
more ▼

asked Nov 02 '18 at 12:18 PM in C++ Programming

avatar image

justdoit7724
8 2 4

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

1 answer: sort voted first

You do that as in any C++ project just need to properly configuratated, here some tutorial on those (UE4 wiki process is currently under maintnence and code formating is broken, click "View Source" to see code snippets properly):

https://wiki.unrealengine.com/How_to_Link_External_C_Libraries_.dll_.lib_With_Your_Project_%26_Package_With_Game,_Fast_And_Easy

But if you making those libraries just for UE4 use, you should avoid doing so. Unity does this because Unity don't provide C/C++ compilation support, so in order to use native C/C++ only libraries or use C/C++ in general you need to make dll which then is used in C# scripts as Mono/.NET supports dll importing.

UE4 doesn't need for that as you got C++ out of the box and form there you could do anything that you can in C++ and if you want to do something separate from main game code you can just make seperate UE4 module which will create seperate dll:

https://docs.unrealengine.com/en-US/Programming/Modules/Gameplay https://docs.unrealengine.com/en-us/Programming/UnrealBuildSystem/ModuleFiles

And optionally you can place this module to plugin to make it reusable in all UE4 projects

https://docs.unrealengine.com/en-us/Programming/Plugins

And regardless if you gonna import dll or rewrite everything in to UE4, you most likely will need to write APIs for UE4 use. UE4 APIs are not compatible with C++ Standard Library or even C standard library, UE4 API use it own standard APIs and warps anything external needed around it and because of that you need to convert types when you use any library that use Standard C++ library types. And obviuesly you need to do when you import dlls too, so if you can do something in UE4 APIs do it in UE4 APIs to make it more compatible and straight forward

more ▼

answered Nov 02 '18 at 04:00 PM

avatar image

Shadowriver
37.2k 936 172 1116

(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