• 使用g++ 编译的时候,g++ main.cpp -std=c++0x -pthread 已经链接了pthread 库。

  • 在Qt工程中要在工程文件.pro中添加链接:

    LIBS += -pthread

    或者:

    QMAKE_CXXFLAGS += -std=gnu++0x -pthread
    QMAKE_CFLAGS += -std=gnu++0x -pthread
  • refer
    [1] https://stackoverflow.com/questions/11710524/how-to-use-pthread-on-qt-creator

Qt Plain C++ Project error: undefined reference to `pthread_create'相关推荐

  1. 【Qt】报错error: undefined reference to `vtable for的解决方法

    1.问题描述 编译Qt程序时,在某个类构造函数定义处报错: error: undefined reference to `vtable for 2.原因分析 导致错误信息的原因是:子类没有实现父类的纯 ...

  2. QT构建编译出现错误error: undefined reference to 的解决办法

    这里要解决问题的是QT构建中的 error: undefined reference to 而不是 undefined reference to vtable for "xxx::xxx&q ...

  3. 【Qt】error: undefined reference to `vtable for MainWindow‘

    1.问题描述 在写一个demo时,想尽量简单,就把MainWindow类的定义和实现都写在main.cpp中,结果编译时报错: main.cpp:-1: error: undefined refere ...

  4. Qt下使用QAxObject进行Word转换为PDF出现错误 error: undefined reference to `QAxObject::QAxObject(QObject*)‘

    Qt下使用QAxObject进行Word转换为PDF出现错误 error: undefined reference to `QAxObject::QAxObject(QObject*)' 首先检查以下 ...

  5. Qt 多线程bug:moc_widget.cpp:-1: error: undefined reference to `Mythread::~Mythread()‘:-1:

    Qt 多线程 moc_widget.cpp:-1: error: undefined reference to `Mythread::~Mythread()' moc_widget.cpp:-1: e ...

  6. QT:error: undefined reference to 'xxxx'错误提示,解决方式

    当你执行QT程序时,突然报错了这个错 error: undefined reference to 'xxxx' 表示未定义 函数 只需要把头文件里的 private slots的指定报错的函数去除了就 ...

  7. error: undefined reference to `PathTrace::PathTrace(World*)' (Codeblocks, C++)

    error: undefined reference to `PathTrace::PathTrace(World*)'  说的是`PathTrace::PathTrace(World*)' 没有被& ...

  8. error: undefined reference to `calculate()`报错

    在调用xx.h和xx.c中的函数,比如calculate()时 如下: #include "xx.h" int t; int result = calculate(t); 此时报错 ...

  9. error: undefined reference to `gsl_vector_get‘

    在qt中用选择C++语言写了如下的代码,报错 error: undefined reference to `gsl_vector_get' gsl库已经顺利导入,代码是复制的使用GSL库实现非线性最小 ...

最新文章

  1. java action处理list_Struts2 -- Jsp取action List及数据映射
  2. 股票交易应用系统的性能分析工具介绍(一)
  3. Bit-Z亮相巴厘岛XBlockchain峰会
  4. BERT-of-Theseus:基于模块替换的模型压缩方法
  5. 视频API的发展方向
  6. 软件工程-pair work
  7. python2 python3 import,从python2到python3的导入处理/模块的更改?
  8. DP专练2 (大理石 + [ZJOI 2010]数字计数)
  9. c语言三阶素数魔方阵,用C语言构造3*3素数魔方阵,即找出9个不大于500的素数并排成魔方阵。...
  10. 转:Jmeter 用户思考时间(User think time),定时器,和代理服务器(proxy server)...
  11. C++学习之路 | PTA乙级—— 1020 月饼 (25分)(带注释)(精简)
  12. python 内置函数 builtins_python学习笔记(七)——内置函数
  13. C语言的静态数组初始化
  14. 2020-10-01
  15. 矩阵键盘及其基本原理
  16. Java操作Excel表读取的数字变成科学计数法
  17. muduo网络库:05---线程同步精要之(线程安全的Singleton实现)
  18. Reactor 反应堆
  19. 积沙成塔之VC不规则按钮的创建
  20. 网页设计与制作教程 项目1

热门文章

  1. np.random.uniform,random,choice,newaxis
  2. [PyTorch] 译+注:一个例子,让你明白PyTorch框架
  3. idea插件安装在哪个目录_从零开始编写自己需要的IntelliJ IDEA 插件
  4. Linux系统瓶颈排查
  5. Android学习之Android 5.0分享动画实现微信点击全屏效果
  6. 自学linux指令分析-mkdir
  7. 'datetime.datetime' has no attribute 'datetime'问题
  8. C# 中格式化字符串中包含 { 或者 } 如何转义?
  9. [转载] Python字典按照keys排序输出为列表
  10. [转载] 【Python】range()、np.arange()、np.linspace()、np.logspace()的使用和区别