Announcement

Collapse
No announcement yet.

External libraries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Last edited by XFran1998X; 11-19-2019, 06:10 AM.

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

    Code:
    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"));
            }
    
    
    
        }

    Comment

    Working...
    X