使用QT Creator查看并调试nginx源码

1.前言由于原先以前被vs2008以及eclipse宠坏了,vi使用又不熟悉,本来想好好学习nginx源码的我很是拙计,我亟需一个IDE来阅读以及调试源代码,于是我看上了QtCreator,,于是本博文就是介绍如何把nginx源码搞成qt creator工程。2.建立.pro文件我们要先学习一下QT Creator的工程文件.pro,因为QTCreator的qmake按照.pro文
摘要由CSDN通过智能技术生成

我的wp博客,欢迎来围观 http://zt2peilong.sinaapp.com/

1.前言

由于原先以前被vs2008以及eclipse宠坏了,vi使用又不熟悉,本来想好好学习nginx源码的我很是拙计,我亟需一个IDE来阅读以及调试源代码,于是我看上了QtCreator,,于是本博文就是介绍如何把nginx源码搞成qt creator工程。

2.建立.pro文件

我们要先学习一下QT Creator的工程文件.pro,因为QTCreator的qmake按照.pro文件生成Makefile的。
现在我们先来看看我们需要用到的.pro配置项

配置项的格式是:key = value

我们需要的key如下

  • TARGET = value这个配置项的意义是QTCreator最后生成的名字叫做“value”的可执行程序
  • DESTDIR = destdir 这个配置项的意义是QTCreator编译过程中的*.o还有可执行程序,全部放到destdir这个文件夹下面
  • LIBS = value 这个配置项的意义是在编译过程中链接的库(这个最初把我坑了一小下)
  • INCLUDEPATH = dir 这个配置项的意思是相关库的头文件目录
  • HEADERS = value 这个是源代码中的.h文件
  • SOURCES = value 这个是源代码中的.c文件
我把我的.pro文件贴出来
TARGET = nginx
DESTDIR = ./objs
LIBS = -lpthread -lcrypt -lpcre -lcrypto -lcrypto -lz
INCLUDEPATH += \
        src/core \
        src/event \
        src/event/modules \
        src/os/unix \
        src/http/modules \
        src/http \
        objs
HEADERS = src/core/nginx.h \
        src/core/ngx_config.h \
        src/core/ngx_core.h \
        src/core/ngx_log.h \
        src/core/ngx_palloc.h \
        src/core/ngx_array.h \
        src/core/ngx_list.h \
        src/core/ngx_hash.h \
        src/core/ngx_buf.h \
        src/core/ngx_queue.h \
        src/core/ngx_string.h \
        src/core/ngx_parse.h \
        src/core/ngx_inet.h \
        src/core/ngx_file.h \
        src/core/ngx_crc.h \
        src/core/ngx_crc32.h \
        src/core/ngx_murmurhash.h \
        src/core/ngx_md5.h \
        src/core/ngx_sha1.h \
        src/core/ngx_rbtree.h \
        src/core/ngx_radix_tree.h \
        src/core/ngx_slab.h \
        src/core/ngx_times.h \
        src/core/ngx_shmtx.h \
        src/core/ngx_connection.h \
        src/core/ngx_cycle.h \
        src/core/ngx_conf_file.h \
        src/core/ngx_resolver.h \
        src/core/ngx_open_file_cache.h \
        src/core/ngx_crypt.h \
        src/event/ngx_event.h \
        src/event/ngx_event_timer.h \
        src/event/ngx_event_posted.h \
        src/event/ngx_event_busy_lock.h \
        src/event/ngx_event_connect.h \
        src/event/ngx_event_pipe.h \
        src/os/unix/ngx_time.h \
        src/os/unix/ngx_errno.h \
        src/os/unix/ngx_alloc.h \
        src/os/unix/ngx_files.h \
        src/os/unix/ngx_channel.h \
        src/os/unix/ngx_shmem.h \
        src/os/unix/ngx_process.h \
        src/os/unix/ngx_setaffinity.h \
        src/os/unix/ngx_setproctitle.h \
        src/os/unix/ngx_atomic.h \
        src/os/unix/ngx_gcc_atomic_x86.h \
        src/os/unix/ngx_thread.h \
        src/os/unix/ngx_socket.h \
        src/os/unix/ngx_os.h \
        src/os/unix/ngx_user.h \
        src/os/unix/ngx_process_cycle.h \
        src/os/unix/ngx_linux_config.h \
        src/os/unix/ngx_linux.h \
        src/core/ngx_regex.h \
        objs/ngx_auto_config.h \
        src/http/ngx_http.h \
        src/http/ngx_http_request.h \
        src/http/ngx_http_config.h \
        src/http/ngx_http_core_module.h \
        src/http/ngx_http_cache.h \
        src/http/ngx_http_variables.h \
        src/http/ngx_http_script.h \
        src/http/ngx_http_upstream.h \
        src/http/ngx_http_upstream_round_robin.h \
        src/http/ngx_http_busy_lock.h \
        src/http/modules/ngx_http_ssi_filter_module.h
SOURCES = src/core/nginx.c \
        src/core/ngx_log.c \
        src/core/ngx_palloc.c \
        src/core/ngx_array.c \
        src/core/ngx_list.c \
        src/core
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值