Issues while implementing declarative engine within a plugin

I’m currently working to extend a plugin used in Unreal. My objective is to extend this plugin by adding a component which has prolog implementation. This way my work group can use a prolog engine in tandem with the unreal engine.
I’m having compilation issues regarding the addition of the header file SWI-cpp2.h within my SWIPrologComponent.h. I’m working with Unreal Engine 5.3 and Visual Studio 2022, both at their latest release.
Within the plugin myPlugin.build.cs file I have the following

PublicIncludePaths.Add(Path.Combine(ThirdParty, "SWIProlog", "headers"));

The path ./MyProject/Plugins/myPlugin/ThirdParty/SWIProlog/headers/ contains all the header files needed for SWI-cpp2.h to work. It also contains a file SWI-cpp2.cpp, I thought It’s still fine over there.
this situation should let me write the following line within the SWIPrologComponent.h:

#pragma once
//other includes
#include "SWI-cpp2.h"
#include "SWIPrologComponent.generated.h"
//rest of the code

Of course, these header libraries are unaltered in their implemetation from their original developer. Thus they should be working without any changes.
However I’m still getting many issues during compilation, sorry for the italian:
I’m having a lot of C4800 errors:
\ThirdParty\SWIProlog\headers\SWI-cpp2-plx.h(115): error C4800: Conversione implicita da 'int' in bool. Possibile perdita di informazioni

I even get other issues like \ThirdParty\SWIProlog\headers\SWI-Stream.h(340): error C4668: 'IOSTREAM_REPLACES_STDIO' non è definita come macro del preprocessore. Sostituzione con '0' per '#if/#elif'.

Also I’m having many issues regarding syntax:
\ThirdParty\SWIProlog\headers\SWI-Stream.h(70): error C2628: 'intptr_t' non può essere seguito da 'int'. Si è omesso ';'?

or
\ThirdParty\SWIProlog\headers\SWI-cpp2.h(1041): error C2334: token imprevisti prima di '{'. Il corpo apparente della funzione verrà ignorato.

Some errors regard class accessibility:
\ThirdParty\SWIProlog\headers\SWI-cpp2.h(1169): error C4670: 'PlExceptionBase': questa classe di base è inaccessibile

I’m at a loss and while searching for ways to solve the issues I came across users that suggest to either ignore the 4800 errors, change the libraries et cetera. All things I can’t do.

I think this issue is about unreal engine compilator, is there a way to fix this issue?

solved it by adding PublicDefinitions.Add("_SWI_CPP2_H"); inside the build.cs file, though I still don’t understand the reason why it works.