Qmake 多文件编译 在项目中的使用
来源:互联网 发布:砸金蛋程序源码 编辑:程序博客网 时间:2024/05/22 17:24
毕设在linux下进行,无界面版本已经ok,然后选择了QT作为GUI开发工具。
因为编译QT需要qmake,所以顺便学了qmake的简单使用,把原项目的makefile改为qmake。
写qmake比纯手写makefile简单不少,提高效率。注意下路径、LIBS、INCLUDEPATH等内容就行了。
1.原makefile:
CFLAGS = -I ../../include/ HEADPATH =../../include/ MYSQL=-L /usr/include/mysql helloworld: init.o sqlToCache.o dataCache.o process.o detect_acvl.o g++ -o helloworld init.o sqlToCache.o dataCache.o process.o detect_acvl.o -lpthread -L/usr/lib/mysql -lmysqlclient -lz init.o: init.cpp $(HEADPATH)sniffer_sqlToCache.h $(HEADPATH)decoder_dataCache.h $(HEADPATH)preprocessor_process.h $(HEADPATH)detect_acvl.hg++ -c $(CFLAGS) init.cpp -lpthread sqlToCache.o: ../Sniffer/sqlToCache.cpp $(HEADPATH)decoder_dataCache.hg++ -c $(CFLAGS) -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lz $(mysql_config --cflags) ../Sniffer/sqlToCache.cpp $(mysql_config --libs) -lpthread dataCache.o: ../Decoder/dataCache.cpp $(HEADPATH)decoder_dataCache.hg++ -c $(CFLAGS) ../Decoder/dataCache.cpp process.o: ../Preprocessor/process.cpp $(HEADPATH)preprocessor_process.h $(HEADPATH)detect_acvl.hg++ -c $(CFLAGS) ../Preprocessor/process.cpp detect_acvl.o: ../DetectionEngine/detect_acvl.cpp $(HEADPATH)detect_acvl.hg++ -c $(CFLAGS) -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lz $(mysql_config --cflags) ../DetectionEngine/detect_acvl.cpp $(mysql_config --libs) clean :rm *.o
2.改为qmake,IDS.pro中需要改写的内容:
####################################################################### Automatically generated by qmake (2.01a) ?? 3? 19 19:00:42 2014######################################################################TEMPLATE = appLIBS += -L/usr/lib/mysql -lmysqlclient -lzTARGET = DEPENDPATH += . \ include \ src/Decoder \ src/DetectionEngine \ src/init \ src/Preprocessor \ src/Sniffer \INCLUDEPATH += . include \ /usr/include/mysql \# InputHEADERS += include/decoder_dataCache.h \ include/detect_acvl.h \ include/preprocessor_process.h \ include/sniffer_sqlToCache.hSOURCES += src/Decoder/dataCache.cpp \ src/DetectionEngine/detect_acvl.cpp \ src/init/init.cpp \ src/Preprocessor/process.cpp \ src/Sniffer/sqlToCache.cpp \
0 0
- Qmake 多文件编译 在项目中的使用
- Qmake在QT中的使用
- Qmake在非Qt程序中的使用
- Ubuntu下 在终端使用 qmake 编译 Qt widgets程序
- QT--项目文件的编写方法和qmake的使用
- Makefile在多文件项目中的使用心得
- VS2010下编译mp4v2及在项目中的使用
- VS2010下编译mp4v2及在项目中的使用
- VS2010下编译mp4v2及在项目中的使用
- Qmake 编译
- 如何把一个目录及其以下的所有文件在qmake项目中打包
- QT 运行QMake生成Pro项目文件
- qmake——创建项目文件
- qt5.3.2在ros(机器人操作系统)中的使用:qmake与cmake(qt5.4.0不适用)
- Qmake使用的pro文件的写法
- qmake使用已经Qt.Pro文件介绍
- 在Linux下使用qmake生成makefile
- extern“c”在项目头文件中的使用
- Java中常见问题(一)
- [LeetCode]Reverse Integer
- 敏捷开发系列之旅 第二站(走近XP极限编程)
- 停止monkey测试的笨方法
- 第四章 多视图应用
- Qmake 多文件编译 在项目中的使用
- 相关子查询(correlated subquery) 与非相关子查询
- 【编程好习惯】使用空格增加可读性
- css 使用技巧
- 黑马程序员 Java基础知识总结-多线程
- Android通过HTTP协议实现多线程下载
- uitextField 设置边框颜色
- PN结
- hdu4279 找规律+小想法