zoukankan      html  css  js  c++  java
  • PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP 未声明(在此函数内第一次使用) 规格严格

    用g++ 编译的时候没有问题,但是用gcc 就出现
    PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP未声明(在此函数内第一次使用) 这样的提示,pthread.h已经包含了,问题出在编译参数上面。

    g++ recursion.c -orecursion -lpthread

    gcc recursion.c -o recursion -lpthread -D_GNU_SOURCE

    gcc 多了一个选项:-D_GNU_SOURCE

    对于Linux下的信号量/读写锁文件进行编译,需要在编译选项中指明-D_GNU_SOURCE
    means the compiler will use the GNU standard of compilation, the superset of all
    other standards under GNU C libraries.

    这是网上转载的,其实很简单,看pthread.h里面,存在宏定义,把它定义出来就可以了

  • 相关阅读:
    Zepto源码分析-动画(fx fx_method)模块
    CSS3用法理解
    移动端网页meta设置和响应式
    javascript基础-正则表达式
    net core 2.x
    angular
    .net core 2.x
    .net core 2.x
    DDD
    DDD
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/2381638.html
Copyright © 2011-2022 走看看