无法编译 bnull-transform.c - Apache Traffic Server

Unable to compile bnull-transform.c - Apache Traffic Server

我正在尝试 运行 Apache 流量服务器的 bnull 转换示例。在对 github 版本的代码进行一些更改后,我终于能够解决错误。但是当我使用 gcc 编译它时,出现以下错误 -

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o: 在函数 _start': (.text+0x20): undefined reference tomain' /tmp/cc5gVORu.o: 在函数中 my_data_alloc': bnull-transform.c:(.text+0x13): undefined reference to_TSmalloc' /tmp/cc5gVORu.o: 在函数 my_data_destroy': bnull-transform.c:(.text+0x7b): undefined reference toTSIOBufferDestroy' 中 bnull-transform.c:(.text+0x87): 对 _TSfree' /tmp/cc5gVORu.o: In functionhandle_buffering' 的未定义引用: bnull-transform.c:(.text+0xa8): 对 TSVConnWriteVIOGet' bnull-transform.c:(.text+0xbe): undefined reference toTSIOBufferCreate 的未定义引用 bnull-transform.c:(.text+0xe7): 对 _TSAssert' bnull-transform.c:(.text+0xf9): undefined reference toTSIOBufferReaderAlloc 的未定义引用 bnull-transform.c:(.text+0x122): 对 _TSAssert' bnull-transform.c:(.text+0x130): undefined reference toTSVIOBufferGet 的未定义引用 bnull-transform.c:(.text+0x155): 对 TSVIONTodoGet' bnull-transform.c:(.text+0x16e): undefined reference toTSVIOReaderGet 的未定义引用 bnull-transform.c:(.text+0x176): 对 TSIOBufferReaderAvail' bnull-transform.c:(.text+0x19f): undefined reference toTSVIOReaderGet 的未定义引用 bnull-transform.c:(.text+0x1bd): 对 TSIOBufferCopy' bnull-transform.c:(.text+0x1cf): undefined reference toTSVIOReaderGet 的未定义引用 bnull-transform.c:(.text+0x1da): 对 TSIOBufferReaderConsume' bnull-transform.c:(.text+0x1e6): undefined reference toTSVIONDoneGet 的未定义引用 bnull-transform.c:(.text+0x1ff): 对 TSVIONDoneSet' bnull-transform.c:(.text+0x20b): undefined reference toTSVIONTodoGet' 的未定义引用 bnull-transform.c:(.text+0x222): 对 TSVIOContGet' bnull-transform.c:(.text+0x233): undefined reference toTSContCall' 的未定义引用 bnull-transform.c:(.text+0x24b): 对 TSVIOContGet' bnull-transform.c:(.text+0x25c): undefined reference toTSContCall 的未定义引用 /tmp/cc5gVORu.o: 在函数 handle_output': bnull-transform.c:(.text+0x294): undefined reference toTSTransformOutputVConnGet' bnull-transform.c:(.text+0x2a8): 未定义对 TSIOBufferReaderAvail' bnull-transform.c:(.text+0x2c6): undefined reference toTSVConnWrite 的引用' bnull-transform.c:(.text+0x2ef): 对 _TSAssert' /tmp/cc5gVORu.o: In functionhandle_transform' 的未定义引用: bnull-transform.c:(.text+0x315): 对 TSContDataGet' bnull-transform.c:(.text+0x341): undefined reference toTSContDataSet' 的未定义引用 /tmp/cc5gVORu.o: 在函数 bnull_transform': bnull-transform.c:(.text+0x3b0): undefined reference toTSVConnClosedGet' bnull-transform.c:(.text+0x3c0): 对 TSContDataGet' bnull-transform.c:(.text+0x3d4): undefined reference toTSContDestroy 的未定义引用 bnull-transform.c:(.text+0x3f1): 对 TSVConnWriteVIOGet' bnull-transform.c:(.text+0x401): undefined reference toTSVIOContGet' 的未定义引用 bnull-transform.c:(.text+0x412): 未定义对 TSContCall' bnull-transform.c:(.text+0x420): undefined reference toTSTransformOutputVConnGet 的引用' bnull-transform.c:(.text+0x432): 对 TSVConnShutdown' /tmp/cc5gVORu.o: In functiontransformable 的未定义引用: bnull-transform.c:(.text+0x46a): 对 TSHttpTxnServerRespGet' bnull-transform.c:(.text+0x47d): undefined reference toTSHttpHdrStatusGet 的未定义引用 bnull-transform.c:(.text+0x49b): 未定义引用 TS_NULL_MLOC' bnull-transform.c:(.text+0x4aa): undefined reference toTSHandleMLocRelease' bnull-transform.c:(.text+0x4be): 对 TSError' /tmp/cc5gVORu.o: In functiontransform_add' 的未定义引用: bnull-transform.c:(.text+0x4e0): 未定义对 TSTransformCreate' bnull-transform.c:(.text+0x4f9): undefined reference toTSHttpTxnHookAdd 的引用' /tmp/cc5gVORu.o: 在函数 transform_plugin': bnull-transform.c:(.text+0x54e): undefined reference toTSHttpTxnReenable 中 /tmp/cc5gVORu.o: 在函数 TSPluginInit': bnull-transform.c:(.text+0x59c): undefined reference toTSPluginRegister' 中 bnull-transform.c:(.text+0x5af): 未定义引用 TSError' bnull-transform.c:(.text+0x5bf): undefined reference toTSError' bnull-transform.c:(.text+0x5d2): 未定义对 TSContCreate' bnull-transform.c:(.text+0x5df): undefined reference toTSHttpHookAdd 的引用' collect2:ld 返回 1 退出状态

请帮忙。

您正在尝试将此插件(它是一个 .so)编译为一个独立的应用程序。那行不通的。您应该使用 ATS 安装附带的 tsxs 脚本,例如

tsxs -o null-transform.so null-transform.cc