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>
这样来调用.
浙公网安备 33010602011771号