UXL and including cpp code

Hey,

I’m trying to understand how this uxl works. I’m reading the uxl handbook and first trying to get some sort of result out of it. So I used the example there.

created Test3.cpp.uxl file:

<Extensions Backend="CPlusPlus">
    <Type Name="Test3">
        <Method Signature="FirstMethod(int):float">
            <Expression>((@{float})%%%~COMPRESS~PRE~15~%%%)</Expression>
        </Method>

        <Method Signature="SecondMethod(int):float">
            <Require Entity="Test3.NonStaticHelper(int)" />
            <Body><![CDATA[
                @{float} tmp = @{Test3.Helper(int):Call(%%%~COMPRESS~PRE~15~%%%)};
                return tmp + @{Test3:Of($).NonStaticHelper(int):Call(%%%~COMPRESS~PRE~15~%%%)};
            ]]></Body>
        </Method>
    </Type>
</Extensions>

And Test3.uno file:

[TargetSpecificImplementation]
class Test3
{
    [TargetSpecificImplementation]
    public extern float FirstMethod(int a);

    [TargetSpecificImplementation]
    public extern float SecondMethod(int a) // SecondMethod has a default implementation
    {
        return 0f;
    }

    public static float Helper(int a)
    {
        return (float)aa;
    }

    public float NonStaticHelper(int a)
    {
        return (float)aa;
    }
}

According to UXL-Handbook this should work, but I get errors from compiler. (dotnetexe build)

Test3.uno(1,2): E3114: There is no identifier named 'TargetSpecificImplementationAttribute' accessible in this scope.

What am I doing wrong here?

My final goal is to include a c++ header and start calling its methods, but first I would like to just get a basic setup for uxl working.

Just add using Uno.Compiler.ExportTargetInterop;