2

价值代码

using TCC;
void main (string[] args) {
    State s = new State ();

    //  s.add_include_path ("/usr/lib/tcc/include");
    //  s.add_include_path ("/usr/include/");
    //  s.set_lib_path ("/usr/lib/tcc");

    s.compile_string ("""   extern int printf(char* c,...);
    int main () {
        printf("Hello world!\n");
        return 0;
    } """    );
    s.run ({ "" });
}

我尝试运行时出错

❯ ./build/exec
tcc: error: library 'c' not found
tcc: error: file 'crtn.o' not found

dirstro:Arch
TCC 版本:0.9.27-3
复制库:https ://gitlab.com/gavr123456789/vala-ttc-example/tree/master

4

0 回答 0