摘要: windows:Sleep(5);(S大写,表示5毫秒) ubuntu:sleep(5);(s小写,表示5秒) 阅读全文
posted @ 2020-11-06 15:07 maycpou 阅读(659) 评论(0) 推荐(0)
摘要: 在Windows的vs中使用std::mutex没有问题,将代码迁移到ubuntu上后报错:‘mutex’ in namespace ‘std’ does not name a type 解决方法:加上头文件 #include <thread> #include <mutex> #include < 阅读全文
posted @ 2020-11-06 15:05 maycpou 阅读(8796) 评论(0) 推荐(0)
摘要: 转自:https://www.cnblogs.com/WindSun/p/12286024.html 在makefile中经常会看到这些选项,gcc默认会在程序当前目录、path路径中查找所需要的材料如何给gcc添加我们自己的原材料(头文件,库等) -I (注意是大写的i) 给gcc添加自定义的头文 阅读全文
posted @ 2020-11-06 11:03 maycpou 阅读(322) 评论(0) 推荐(0)
摘要: 不需要安装包,但是编译的时候需要手动包含pthread包:g++ threadtest1.cpp -lpthread -o threadtest1 测试代码: #include <pthread.h>#include <stdlib.h>#include <stdio.h>#include <str 阅读全文
posted @ 2020-11-06 10:26 maycpou 阅读(2854) 评论(0) 推荐(0)