global.h 源文件

#include <iostream>
#include <cstdio>
 #include <cstdlib>
 #include <cerrno>
 #include <pthread.h>
#include <fcntl.h>
#define MAXBLOCK 250
#define BUFFNUM 200
#define blockSize 16
#ifndef GLOBAL_HEADER_H
#define GLOBAL_HEADER_H

//定义三个全局变量
extern unsigned long blockIndex; 
extern int fileFd;
extern int bufferNum;

//声明结构体相关的指针
extern buff_node *head;  //定义指向结构体的头节点指针
extern buff_node *tail;  //定义指向结构体的尾节点指针
extern buff_node *temp;

//声明三个函数
extern void bufferInit(void);
extern void *blkProducer(void *);
extern void *blkConsumer(void *);

//声明三个互斥量
extern pthread_mutex_t stderrMutex;
extern pthread_mutex_t stdoutMutex;
extern pthread_mutex_t bufferMutex;

//声明buffer的两个变量
extern pthread_cond_t bufferReadCond;
extern pthread_cond_t bufferWriteCond;
#endif

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
转成cmake,HEADERS += \ $$PWD/AES/AES.h \ $$PWD/AutoSendDirectionCorrect/AutoSendDirectionCorrect.h \ $$PWD/HPSocket/HPSocket-SSL.h \ $$PWD/HPSocket/HPSocket.h \ $$PWD/HPSocket/HPSocket4C-SSL.h \ $$PWD/HPSocket/HPSocket4C.h \ $$PWD/HPSocket/HPTypeDef.h \ $$PWD/HPSocket/SocketInterface.h \ $$PWD/IFF/IFFDicts.h \ $$PWD/IFFDeal/IFFDeal.h \ $$PWD/IFFDeal/IFFStructFile.h \ $$PWD/IFFDeal/countrydata.h \ $$PWD/Itemdelegate/item_color_delegate.h \ $$PWD/Itemdelegate/item_height_delegate.h \ $$PWD/MyThreadSaveFile/mythreadsavefile.h \ $$PWD/MyUdpNode/my_udp_node.h \ $$PWD/PaUnitConvert/PaUnitConvert.h \ $$PWD/QMyDataDictionary/IniUtils.h \ $$PWD/QMyDataDictionary/QDataDictionary.h \ $$PWD/QMyLineEdit/QMyLineEdit.h \ $$PWD/QMyToolButton/QMyToolButton.h \ $$PWD/ST_Common/common.h \ $$PWD/RadarCommon/radar_result.h \ $$PWD/ST_Interpulse/interpulse_result.h \ $$PWD/ST_RadarCommon/RadarArrayConv.h \ $$PWD/ST_RadarCommon/RadarDicts.h \ $$PWD/ST_RadarCommon/iff.h \ $$PWD/ST_RadarCommon/radar_result.h \ $$PWD/ST_JamSrc/commonJamming.h \ $$PWD/global/global.h SOURCES += \ $$PWD/AES/AES.cpp \ $$PWD/AutoSendDirectionCorrect/AutoSendDirectionCorrect.cpp \ $$PWD/IFF/IFFDicts.cpp \ $$PWD/IFFDeal/IFFDeal.cpp \ $$PWD/CommunalData/CommunalData.cpp \ $$PWD/Itemdelegate/item_color_delegate.cpp \ $$PWD/Itemdelegate/item_height_delegate.cpp \ $$PWD/MyThreadSaveFile/mythreadsavefile.cpp \ $$PWD/MyUdpNode/my_udp_node.cpp \ $$PWD/QMyDataDictionary/IniUtils.cpp \ $$PWD/QMyDataDictionary/QDataDictionary.cpp \ $$PWD/QMyLineEdit/QMyLineEdit.cpp \ $$PWD/QMyToolButton/QMyToolButton.cpp \ $$PWD/ST_RadarCommon/RadarArrayConv.cpp \ $$PWD/ST_RadarCommon/RadarDicts.cpp \ $$PWD/global/global.cpp
06-08
你可以使用以下的 CMakeLists.txt 文件来转换这些源文件和头文件: ``` cmake_minimum_required(VERSION 3.1) project(MyProject) set(CMAKE_CXX_STANDARD 11) set(SOURCES AES/AES.cpp AutoSendDirectionCorrect/AutoSendDirectionCorrect.cpp CommunalData/CommunalData.cpp IFF/IFFDicts.cpp IFFDeal/IFFDeal.cpp Itemdelegate/item_color_delegate.cpp Itemdelegate/item_height_delegate.cpp MyThreadSaveFile/mythreadsavefile.cpp MyUdpNode/my_udp_node.cpp QMyDataDictionary/IniUtils.cpp QMyDataDictionary/QDataDictionary.cpp QMyLineEdit/QMyLineEdit.cpp QMyToolButton/QMyToolButton.cpp ST_Common/common.cpp ST_Interpulse/interpulse_result.cpp ST_JamSrc/commonJamming.cpp ST_RadarCommon/RadarArrayConv.cpp ST_RadarCommon/RadarDicts.cpp ST_RadarCommon/iff.cpp ST_RadarCommon/radar_result.cpp global/global.cpp ) set(HEADERS AES/AES.h AutoSendDirectionCorrect/AutoSendDirectionCorrect.h CommunalData/CommunalData.h HPSocket/HPSocket-SSL.h HPSocket/HPSocket.h HPSocket/HPSocket4C-SSL.h HPSocket/HPSocket4C.h HPSocket/HPTypeDef.h HPSocket/SocketInterface.h IFF/IFFDicts.h IFFDeal/IFFDeal.h IFFDeal/IFFStructFile.h IFFDeal/countrydata.h Itemdelegate/item_color_delegate.h Itemdelegate/item_height_delegate.h MyThreadSaveFile/mythreadsavefile.h MyUdpNode/my_udp_node.h PaUnitConvert/PaUnitConvert.h QMyDataDictionary/IniUtils.h QMyDataDictionary/QDataDictionary.h QMyLineEdit/QMyLineEdit.h QMyToolButton/QMyToolButton.h RadarCommon/radar_result.h ST_Common/common.h ST_Interpulse/interpulse_result.h ST_JamSrc/commonJamming.h ST_RadarCommon/RadarArrayConv.h ST_RadarCommon/RadarDicts.h ST_RadarCommon/iff.h ST_RadarCommon/radar_result.h global/global.h ) add_executable(MyExecutable ${SOURCES} ${HEADERS}) ``` 这个 CMakeLists.txt 文件将所有的源文件和头文件添加到一个名为 MyExecutable 的可执行文件中。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值