
Qt/C++
文章平均质量分 70
三级狗
扎实基础
展开
-
Linux C/C++ PGO优化说明
PGO是指利用程序运行过程中采集到的 profile 数据,来重新编译程序以达到优化效果的 post-link 优化技术。原创 2023-03-21 10:44:07 · 2638 阅读 · 1 评论 -
Linux绑核效率优化
cpu一般有多个物理核心,但在运行进程和线程时候,可以将其绑定或者指定到某一个或者多个核心上运行,提升运行效率。原创 2023-03-21 10:02:21 · 1851 阅读 · 1 评论 -
万字长文系统梳理C++函数指针
本篇的内容相对比较简单主要从语法的层面讲解函数指针的使用以及应用场景。都是些面向入门者的基础,大佬轻喷。首先:什么是函数指针。这个问题老生常谈了,不用理解的多么复杂,它其实就是一个特殊的指针,它用于指向函数被加载到的内存首地址,可用于实现函数调用。听上有点像函数名,函数名也是记录了函数在内存中的首地址,加()就可以调用。不错,不过函数指针和函数名还是有点区别的,他们虽然都指向了函数在内存的入口地址,但函数指针本身是个指针变量,对他做&取地址的话会拿到这个变量本身的地址去。而对函数名做.原创 2020-08-05 16:28:48 · 3749 阅读 · 3 评论 -
C++到底是如何从代码到游戏的?
这个简单啊。你既然问C++了,那我问你,现在,我有一个Student类。C++怎么创建一个学生类的对象?// 嗯我会!有两种方式:Student s;Student *s2 = new Student("张三");那好,现在这学生的行为有:吃饭,睡觉,上网课。现在你执行个上网课的行为,怎么做?// 简单啊s2->upNetworkClass();通过对象调用成员函数不就成...原创 2020-04-29 20:30:40 · 12390 阅读 · 32 评论 -
error: undefined symbol: std::__cxx11::basic_string和std::__1::basic_string
undefined symbol: cv::imwrite(cv::String const&, cv::_InputArray const&, std::__1::vector<int, std::__1::allocator > const&)原创 2020-03-09 15:48:38 · 31918 阅读 · 6 评论 -
g++编译详解
g++编译详解资料准备:为了方便演示和讲解,在这里提前准备好几个简单的文件:test.cpp test.h main.cpp 文件内容如下:main.cpp//main.cppint main (int argc, char **argv){ return 0;}test.h//test.h#ifndef _TEST_H_ #define _TEST_H_ ...原创 2019-12-24 18:50:20 · 50189 阅读 · 9 评论 -
g++编译报错:specialization of template.... in different namespace解决方案
specialization of template… in different namespace解决方案同样的代码,使用clang++编译通过,可是使用g++报错如下:error: specialization of 'template<class _Tp> struct std::hash' in different namespace [-fpermissive] clas...原创 2019-09-11 11:59:43 · 4892 阅读 · 1 评论 -
error: current translation unit is compiled with the target feature '-fsanitize=address' but the AST
使用cmake生成Makefile 编译C++项目时出现报错:error: current translation unit is compiled with the target feature '-fsanitize=address' but the AST file was not一般情况下,这个是由于两次编译时的flags不一样导致的。我这里首次执行cmake时,生成的flags....原创 2019-09-03 14:49:46 · 751 阅读 · 0 评论 -
Qt编译时出现GTK theme support ......no 解决方案
解决方案: 安装 libpng{}-dev的库sudo apt-get install libpng-devsudo apt-get install libpng12-devsudo apt-get install libpng16-dev上面三条视系统中的依赖版本,ubuntu16.04下使用的是libpng12一般libxxx库中安装的是.so文件而libxxx-dev库...原创 2019-08-30 15:59:01 · 924 阅读 · 4 评论 -
Linux Qt 加载 MySql “QMYSQL driver not loaded”
Linux Qt 加载 MySql “QMYSQL driver not loaded”查看是否存在MySQL的库在Qt的安装目录下~/ThreeDog/qt/5.7/gcc_64/plugins/sqldrivers/如果有的话查看库是否可用,ldd这里可以看到系统缺这几个库查看这几个库在系统中是否存在如果不存在sudo apt-get install opensslsudo...原创 2019-08-29 18:26:38 · 1472 阅读 · 0 评论 -
C++编译错误 :error: explicit qualification in declaration of xxx
explicit qualification in declaration原创 2019-08-29 18:08:24 · 4534 阅读 · 1 评论