How can I include external (native to C++ but not UE4) Header files?

Hey guys,

I’m trying to make a couple of operations inside a c++ Blueprint Function. One of the things I want to do is use Logarithms. However, so far in the documentation the only Log-related function in FMath is Log2. While this is useful, I would like to have the freedom of utilizing any base of Log. I know that the standard C++ “Math.h” does have this option in it. However, referencing it in #Include is resulting in errors. Do I need to get the full path of the Visual Studio Header for it to work?

In case that wouldn’t be a possibility, how could I approach it (and for other math-based operations that are not included in FMath)?

For the Specific Log Example, I simply used Loge(y) / loge(desired log base).

The Question still stands though.

Maybe this is what you looking for? (remember to use FMath instead of FGenericPlatfromMath)

I am already including FMath and am not using GenericPlatformMath.

What I used was a simple Loge(x) and then just transform the Ln into a Log.

The question still stands though; How would I reference External Headers to UE4’s library? Is that recommended?

I’m asking because I want to make some experiments with a wide variety of mathematical functions and from the Documentation, many of what I’m looking for don’t seem to be included.

So to include external headers, you need to add the path of the headers to PublicIncludePaths located in your module build rules (YourProjectName.build.cs). Project needs to be recompiled after edit to make the headers accessible in code.

The above works if its a header only library, if the headers are part of a compiled object then additional steps are required depending on whether its a dll or a static library.

You should not reference the std library this way though, and honestly for 99.999% you do not need it.

for that 0.001% of the time you compile a separate library, that uses the standard and provides a C interface for a UE module to consume.

Note there are no such thing as C++ native headers.
The Std Library headers are part of a compiled static library which the compiler your using on that piece of code has been built with.

I’ll see how I can make the functions that I need without having to include external packages.

Thanks!