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 @   zjh6  阅读(16)  评论(0编辑  收藏  举报  
努力加载评论中...
点击右上角即可分享
微信分享提示