sudo apt-get install uuid-dev

安装生成uuid的库

#include <iostream>;
#include <stdio.h>;
#include <uuid/uuid.h>;

int main()
{
        uuid_t uu;
        uuid_generate( uu );
        std::cout << uu << std::endl;
        int i;
        for(i=0;i<16;i++)
        {
            printf("%x  ",uu);
        }
        printf("\n");
        return 0;
}

编译的时候需要将对应的库添加上:

#g++ -o –luuid uuid uuid.o

相关文章:

  • 2021-05-16
  • 2022-12-23
  • 2022-02-08
  • 2021-09-30
  • 2022-01-04
  • 2021-06-10
  • 2021-11-01
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案