Getting basic C++ Haxe example running

I am attempting to build a very simple example of an extern I am creating using Haxe using a simple C++ class/header file:

My folder structure looks like this:

BasicCppExtern
    bin/
    include/test.h
    lib/Test.lib
    src/Main.hx
    src/Test.hx

My Test.hx file looks like this:

@:include("../../include/test.h")
@:structAccess
@:native("TestClass")
extern class Test
{
    @:native("new TestClass")
    public static function create():Pointer<Test>;
    
    @:native("output")
    public function output(text:ConstPointer<Char>):Void;
    
}

Followed by my main class, which injects some XML to link everything together:

using cpp.NativeString;

@:buildXml('
    <set name="LIB_BCPPEXTERN" value="../" />



<target id="test.ndll" tool="linker" toolid="${STD_MODULE_LINK}" output="bin/basic/">
        <files id="files"/>
        <outdir name="../ndll/windows/"/>
        
        <section unless="static_link">
        
            <section if="windows">
                <lib name="${LIB_BCPPEXTERN}lib/Test.lib" />
            </section>
        
        </section>
    </target>
    <files id="files">
        <compilerflag value="-Iinclude/" />
        <compilerflag value="-D__WIN32__" />
        <compilerflag value="-Ddebug" />
        <compilerflag value="-Dstatic_link" />
        
    </files>
')
@:keep class Main 
{
    
    static function main() 
    {
        var t = Test.create();
        t.value.output("This is some text".c_str());
    }
    
}

It compiles successfully, and I’m thinking of testing this further with larger libraries as I go. But once it gets to the linker, hxcpp does not seem to get the paths to the *.lib files correctly, getting the LNK2019 errors which as far as I am concerned is normally a problem with the *.lib. I built the Lib file using Debug configuration, so does that mean there is a special flag I need to use for it to link properly?

However, if it helps, I have a screenshot of the errors from the linker here:

It baffles me that even the simplest of tasks causes me errors.

Perhaps it might help to check out some of the “linc” libraries, I believe they use HXCPP externs, it might help to see how they have it constructed:

I understand the concept, otherwise it would not have found the “*.h” files and I would be stuck at step zero. I have hxcpp able to use the link.exe to build the application’s generated C++ files, but no matter how many changes I make to the @:buildXml it just does not understand how to pick up *.lib files.

I guess I’m just too stupid to understand it.

Maybe something in the “target” section?