11 2020 档案

摘要:使用vs2019创建了一个简单的c++控制台项目,该程序就向控制台输出一句“hello world!” 另一台无环境的win10计算机:原本只有Microsoft Visual C++ 2013 Redistributable(x64) 和Microsoft Visual C++ 2013 Redi 阅读全文
posted @ 2020-11-23 16:24 maycpou 阅读(2164) 评论(0) 推荐(1)
摘要:在我们的c++程序中,引用别人的库的时候有两种方式:静态库和动态库 动态库:动态库有两个文件,一个lib文件和一个dll文件。lib文件中包含了方法名和方法所在的dll等索引信息,并不包含方法的具体实现,方法的具体实现在dll文件中。在编译阶段我们只需要lib文件,只要相应的lib文件引用没有问题, 阅读全文
posted @ 2020-11-23 11:15 maycpou 阅读(561) 评论(0) 推荐(0)
摘要:命令:TREE /F 阅读全文
posted @ 2020-11-18 14:12 maycpou 阅读(2246) 评论(0) 推荐(0)
摘要:windows:Sleep(5);(S大写,表示5毫秒) ubuntu:sleep(5);(s小写,表示5秒) 阅读全文
posted @ 2020-11-06 15:07 maycpou 阅读(681) 评论(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 阅读(8840) 评论(0) 推荐(0)
摘要:转自:https://www.cnblogs.com/WindSun/p/12286024.html 在makefile中经常会看到这些选项,gcc默认会在程序当前目录、path路径中查找所需要的材料如何给gcc添加我们自己的原材料(头文件,库等) -I (注意是大写的i) 给gcc添加自定义的头文 阅读全文
posted @ 2020-11-06 11:03 maycpou 阅读(341) 评论(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 阅读(2881) 评论(0) 推荐(0)