Nginx模块引入C++方法

大方法:
     模块使用C++ 编译。
     nginx服务器也需要使用C++编绎。

1.在模块中,
extern "C" {
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
}
引入"C"模块。

2.在objs/Makefile中,修改, 
CPP =   g++
LINK =  $(CPP)

其中,对于该模块,使用$(CPP)进行编绎。
3.如果觉得麻烦,需要每次configure之后都要再修改的话,可以直接修改源码目录下 auto/make 里的
CPP = g++
LINK = g++
和将
# the addons sources 下的ngx_cc 改成 $(CPP) , 这样会将所有的模块都变成g++编译,可以通过后缀名来判断使用什么编译器来编译。
原文地址:https://www.cnblogs.com/liangxing/p/1959441.html