Download

External libraries

Hi everyone!

I’m new in this of programing with unreal and I wanted to know if can I use libreries such cstdlib or windows.h. I have a programe that send/get an information from COM port and I wanted to implement that on unreal using Actors to send information or move actors when get a especific info.

I saw I can make a module with my .cpp and .h but i don’t know if I includeHi everyone!

I’m new in this ob programing with unreal and I wanted to know if can I use libreries such <cstdlib> or <windows.h>. I have a programe that send/get an information from COM port and I wanted to implement that on unreal using Actors to send information or move actors when get a especific info.

I saw I can make a module with my .cpp and .h but i don’t know if can I include some external libraries like I mentioned after.

You can certainly add extra libs and headers for sure. Just see your project build.cs.


public SmartWorldPro(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicDependencyModuleNames.AddRange(
            new string] {
                "Core",
                "CoreUObject",
                "Engine",
                "InputCore",
                "HeadMountedDisplay",
                "NavigationSystem",
                "AIModule",
                "Http",
                "Json",
                "JsonUtilities",
                "Slate",
                "UMG",
                "SlateCore",
                "ImageWriteQueue",
                "DatabaseSupport",
                "AssetRegistry",
                "libprotobuf"
            }
       );

        PrivateDependencyModuleNames.AddRange(new string] { "ImageWrapper" , "RenderCore", "Slate","BlankPlugin","GeoLocation",
                "SlateCore"});


        bool isLibrarySupported = false;

        if (Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.Win32)
        {
            isLibrarySupported = true;


            string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "" : "";
            string LibrariesPath = Path.Combine(ThirdPartyPath, "lib", "win64");
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libprotobuf" + PlatformString + ".lib"));
        }

        if (isLibrarySupported)
        {
            PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "ProtoBuf", "include"));
        }



    }