COMMUNITY

Linking *.a static libraries with hxcpp

haxe-cpp

(Tomasz Kwiatek) #1

What I got is *.a library and *.h header. I want to use them in my application. Haw can I link them with my project.
C code in my app is already done but I have no idea how to attach .a lib.


@:cppFileCode('
#include <iostream>
#include <dlfcn.h>
#include <../../lib_hellgo.h>

using namespace std;

void THIS_IS_CALLLLLLBACK(){ 
    cout << "CALLLLLLBACK" << endl;
}

void _init(){
    void (*fptr)() = THIS_IS_CALLLLLLBACK;
    registerRequestCallback(&fptr);
}
')

(Tomasz Kwiatek) #2

solved :slight_smile:

@:buildXml('
<target id="haxe">
    <flag value="-L.."/>
    <lib name="-l_hellgo" />
</target>
')