Hi! I’ve followed a tutorial about linking static libraries
But whenever I try to add a custom header file on a test actor, with the library class functions, this happens:
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(232): error C2059: syntax error: 'constant'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(232): error C2238: unexpected token(s) preceding ';'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(227): error C2059: syntax error: 'constant'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(397): error C2059: syntax error: 'constant'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(401): error C2039: 'InSourceTextIndex': is not a member of 'FShapedGlyphSequence::FSourceTextRange'
2> C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(224): note: see declaration of 'FShapedGlyphSequence::FSourceTextRange'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(402): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(402): error C2039: 'int32': is not a member of 'FShapedGlyphSequence::FSourceTextRange'
2> C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(224): note: see declaration of 'FShapedGlyphSequence::FSourceTextRange'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(402): error C2146: syntax error: missing ';' before identifier 'InternalIndex'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(402): error C2039: 'InternalIndex': is not a member of 'FShapedGlyphSequence::FSourceTextRange'
2> C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(224): note: see declaration of 'FShapedGlyphSequence::FSourceTextRange'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(402): error C2039: 'InSourceTextIndex': is not a member of 'FShapedGlyphSequence::FSourceTextRange'
2> C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(224): note: see declaration of 'FShapedGlyphSequence::FSourceTextRange'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(402): error C2039: 'SourceTextRange': is not a member of 'FShapedGlyphSequence::FSourceTextRange'
2> C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(224): note: see declaration of 'FShapedGlyphSequence::FSourceTextRange'
2>C:\Program Files (x86)\Epic Games\4.11\Engine\Source\Runtime\SlateCore\Public\Fonts\FontCache.h(403): error C2065: 'InternalIndex': undeclared identifier
2> -------- End Detailed Actions Stats -----------------------------------------------------------
My actor is as follows:
ServerActor.h
#pragma once
#include "GameFramework/Actor.h"
#include "snap7.h"
#include "ServerActor.generated.h"
UCLASS()
class TESTPLC_API AServerActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AServerActor();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
};
And my Build.CS
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.IO;
public class TestPLC : ModuleRules
{
private string ModulePath
{
get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
}
private string ThirdPartyPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
}
public bool LoadSnap7(TargetInfo Target)
{
bool isLibrarySupported = false;
if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
{
isLibrarySupported = true;
string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "x86";
string LibrariesPath = Path.Combine(ThirdPartyPath, "Snap7", "Libraries");
//PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Snap7." + PlatformString + ".lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Snap7.lib"));
}
if (isLibrarySupported)
{
// Include path
PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Snap7", "Includes"));
PublicIncludePaths.AddRange(new string] { "../../ThirdParty/Snap7/Includes"});
}
Definitions.Add(string.Format("WITH_SNAP7_BINDING={0}", isLibrarySupported ? 1 : 0));
return isLibrarySupported;
}
public TestPLC(TargetInfo Target)
{
MinFilesUsingPrecompiledHeaderOverride = 1;
bFasterWithoutUnity = true;
PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore" });
LoadSnap7(Target);
}
}
The header file is located in ThirdParty/Snap7/Includes and this route is included in the VC++ directories
I’m pretty desesperated and can’t find a way to solve this issue, thank you
PD: I’m using UE 4.11