vim与c++结合

参考地址

extern "C"
{  
    static char null_terminated_string[2048];
    char* _declspec(dllexport) Meow(char *arg) 
    {
        strncpy(null_terminated_string, arg, std::min(sizeof(null_terminated_string), strlen(arg));
        return null_terminated_string;
    }
}

dll:

test.dll: test.cpp
cl /LD test.cpp
clean: 
    del *.obj
    del *.dll
    del *.exp
    del *.lib
:call libcall("test.dll","Meow",0)<cr>

这样来调用.

posted @ 2020-11-07 08:59  zjh6  阅读(23)  评论(0)    收藏  举报  来源