我想为我的应用程序生成UUID,以区分我的应用程序的每个安装.我想在没有boost库支持的情况下使用C++生成这个UUID.如何使用其他一些开源库生成UUID?
注意:我的平台是windows
如评论中所述,您可以使用UuidCreate
#pragma comment(lib, "rpcrt4.lib") // UuidCreate - Minimum supported OS Win 2000 #include <windows.h> #include <iostream> using namespace std; int main() { UUID uuid; UuidCreate(&uuid); char *str; UuidToStringA(&uuid, (RPC_CSTR*)&str); cout<<str<<endl; RpcStringFreeA((RPC_CSTR*)&str); return 0; }