无法编译 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 to
main'
/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 to
TSIOBufferDestroy' 中
bnull-transform.c:(.text+0x87): 对 _TSfree'
/tmp/cc5gVORu.o: In function
handle_buffering' 的未定义引用:
bnull-transform.c:(.text+0xa8): 对 TSVConnWriteVIOGet'
bnull-transform.c:(.text+0xbe): undefined reference to
TSIOBufferCreate 的未定义引用
bnull-transform.c:(.text+0xe7): 对 _TSAssert'
bnull-transform.c:(.text+0xf9): undefined reference to
TSIOBufferReaderAlloc 的未定义引用
bnull-transform.c:(.text+0x122): 对 _TSAssert'
bnull-transform.c:(.text+0x130): undefined reference to
TSVIOBufferGet 的未定义引用
bnull-transform.c:(.text+0x155): 对 TSVIONTodoGet'
bnull-transform.c:(.text+0x16e): undefined reference to
TSVIOReaderGet 的未定义引用
bnull-transform.c:(.text+0x176): 对 TSIOBufferReaderAvail'
bnull-transform.c:(.text+0x19f): undefined reference to
TSVIOReaderGet 的未定义引用
bnull-transform.c:(.text+0x1bd): 对 TSIOBufferCopy'
bnull-transform.c:(.text+0x1cf): undefined reference to
TSVIOReaderGet 的未定义引用
bnull-transform.c:(.text+0x1da): 对 TSIOBufferReaderConsume'
bnull-transform.c:(.text+0x1e6): undefined reference to
TSVIONDoneGet 的未定义引用
bnull-transform.c:(.text+0x1ff): 对 TSVIONDoneSet'
bnull-transform.c:(.text+0x20b): undefined reference to
TSVIONTodoGet' 的未定义引用
bnull-transform.c:(.text+0x222): 对 TSVIOContGet'
bnull-transform.c:(.text+0x233): undefined reference to
TSContCall' 的未定义引用
bnull-transform.c:(.text+0x24b): 对 TSVIOContGet'
bnull-transform.c:(.text+0x25c): undefined reference to
TSContCall 的未定义引用
/tmp/cc5gVORu.o: 在函数 handle_output':
bnull-transform.c:(.text+0x294): undefined reference to
TSTransformOutputVConnGet'
bnull-transform.c:(.text+0x2a8): 未定义对 TSIOBufferReaderAvail'
bnull-transform.c:(.text+0x2c6): undefined reference to
TSVConnWrite 的引用'
bnull-transform.c:(.text+0x2ef): 对 _TSAssert'
/tmp/cc5gVORu.o: In function
handle_transform' 的未定义引用:
bnull-transform.c:(.text+0x315): 对 TSContDataGet'
bnull-transform.c:(.text+0x341): undefined reference to
TSContDataSet' 的未定义引用
/tmp/cc5gVORu.o: 在函数 bnull_transform':
bnull-transform.c:(.text+0x3b0): undefined reference to
TSVConnClosedGet'
bnull-transform.c:(.text+0x3c0): 对 TSContDataGet'
bnull-transform.c:(.text+0x3d4): undefined reference to
TSContDestroy 的未定义引用
bnull-transform.c:(.text+0x3f1): 对 TSVConnWriteVIOGet'
bnull-transform.c:(.text+0x401): undefined reference to
TSVIOContGet' 的未定义引用
bnull-transform.c:(.text+0x412): 未定义对 TSContCall'
bnull-transform.c:(.text+0x420): undefined reference to
TSTransformOutputVConnGet 的引用'
bnull-transform.c:(.text+0x432): 对 TSVConnShutdown'
/tmp/cc5gVORu.o: In function
transformable 的未定义引用:
bnull-transform.c:(.text+0x46a): 对 TSHttpTxnServerRespGet'
bnull-transform.c:(.text+0x47d): undefined reference to
TSHttpHdrStatusGet 的未定义引用
bnull-transform.c:(.text+0x49b): 未定义引用 TS_NULL_MLOC'
bnull-transform.c:(.text+0x4aa): undefined reference to
TSHandleMLocRelease'
bnull-transform.c:(.text+0x4be): 对 TSError'
/tmp/cc5gVORu.o: In function
transform_add' 的未定义引用:
bnull-transform.c:(.text+0x4e0): 未定义对 TSTransformCreate'
bnull-transform.c:(.text+0x4f9): undefined reference to
TSHttpTxnHookAdd 的引用'
/tmp/cc5gVORu.o: 在函数 transform_plugin':
bnull-transform.c:(.text+0x54e): undefined reference to
TSHttpTxnReenable 中
/tmp/cc5gVORu.o: 在函数 TSPluginInit':
bnull-transform.c:(.text+0x59c): undefined reference to
TSPluginRegister' 中
bnull-transform.c:(.text+0x5af): 未定义引用 TSError'
bnull-transform.c:(.text+0x5bf): undefined reference to
TSError'
bnull-transform.c:(.text+0x5d2): 未定义对 TSContCreate'
bnull-transform.c:(.text+0x5df): undefined reference to
TSHttpHookAdd 的引用'
collect2:ld 返回 1 退出状态
请帮忙。
您正在尝试将此插件(它是一个 .so)编译为一个独立的应用程序。那行不通的。您应该使用 ATS 安装附带的 tsxs 脚本,例如
tsxs -o null-transform.so null-transform.cc
我正在尝试 运行 Apache 流量服务器的 bnull 转换示例。在对 github 版本的代码进行一些更改后,我终于能够解决错误。但是当我使用 gcc 编译它时,出现以下错误 -
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o: 在函数 _start':
(.text+0x20): undefined reference to
main'
/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 to
TSIOBufferDestroy' 中
bnull-transform.c:(.text+0x87): 对 _TSfree'
/tmp/cc5gVORu.o: In function
handle_buffering' 的未定义引用:
bnull-transform.c:(.text+0xa8): 对 TSVConnWriteVIOGet'
bnull-transform.c:(.text+0xbe): undefined reference to
TSIOBufferCreate 的未定义引用
bnull-transform.c:(.text+0xe7): 对 _TSAssert'
bnull-transform.c:(.text+0xf9): undefined reference to
TSIOBufferReaderAlloc 的未定义引用
bnull-transform.c:(.text+0x122): 对 _TSAssert'
bnull-transform.c:(.text+0x130): undefined reference to
TSVIOBufferGet 的未定义引用
bnull-transform.c:(.text+0x155): 对 TSVIONTodoGet'
bnull-transform.c:(.text+0x16e): undefined reference to
TSVIOReaderGet 的未定义引用
bnull-transform.c:(.text+0x176): 对 TSIOBufferReaderAvail'
bnull-transform.c:(.text+0x19f): undefined reference to
TSVIOReaderGet 的未定义引用
bnull-transform.c:(.text+0x1bd): 对 TSIOBufferCopy'
bnull-transform.c:(.text+0x1cf): undefined reference to
TSVIOReaderGet 的未定义引用
bnull-transform.c:(.text+0x1da): 对 TSIOBufferReaderConsume'
bnull-transform.c:(.text+0x1e6): undefined reference to
TSVIONDoneGet 的未定义引用
bnull-transform.c:(.text+0x1ff): 对 TSVIONDoneSet'
bnull-transform.c:(.text+0x20b): undefined reference to
TSVIONTodoGet' 的未定义引用
bnull-transform.c:(.text+0x222): 对 TSVIOContGet'
bnull-transform.c:(.text+0x233): undefined reference to
TSContCall' 的未定义引用
bnull-transform.c:(.text+0x24b): 对 TSVIOContGet'
bnull-transform.c:(.text+0x25c): undefined reference to
TSContCall 的未定义引用
/tmp/cc5gVORu.o: 在函数 handle_output':
bnull-transform.c:(.text+0x294): undefined reference to
TSTransformOutputVConnGet'
bnull-transform.c:(.text+0x2a8): 未定义对 TSIOBufferReaderAvail'
bnull-transform.c:(.text+0x2c6): undefined reference to
TSVConnWrite 的引用'
bnull-transform.c:(.text+0x2ef): 对 _TSAssert'
/tmp/cc5gVORu.o: In function
handle_transform' 的未定义引用:
bnull-transform.c:(.text+0x315): 对 TSContDataGet'
bnull-transform.c:(.text+0x341): undefined reference to
TSContDataSet' 的未定义引用
/tmp/cc5gVORu.o: 在函数 bnull_transform':
bnull-transform.c:(.text+0x3b0): undefined reference to
TSVConnClosedGet'
bnull-transform.c:(.text+0x3c0): 对 TSContDataGet'
bnull-transform.c:(.text+0x3d4): undefined reference to
TSContDestroy 的未定义引用
bnull-transform.c:(.text+0x3f1): 对 TSVConnWriteVIOGet'
bnull-transform.c:(.text+0x401): undefined reference to
TSVIOContGet' 的未定义引用
bnull-transform.c:(.text+0x412): 未定义对 TSContCall'
bnull-transform.c:(.text+0x420): undefined reference to
TSTransformOutputVConnGet 的引用'
bnull-transform.c:(.text+0x432): 对 TSVConnShutdown'
/tmp/cc5gVORu.o: In function
transformable 的未定义引用:
bnull-transform.c:(.text+0x46a): 对 TSHttpTxnServerRespGet'
bnull-transform.c:(.text+0x47d): undefined reference to
TSHttpHdrStatusGet 的未定义引用
bnull-transform.c:(.text+0x49b): 未定义引用 TS_NULL_MLOC'
bnull-transform.c:(.text+0x4aa): undefined reference to
TSHandleMLocRelease'
bnull-transform.c:(.text+0x4be): 对 TSError'
/tmp/cc5gVORu.o: In function
transform_add' 的未定义引用:
bnull-transform.c:(.text+0x4e0): 未定义对 TSTransformCreate'
bnull-transform.c:(.text+0x4f9): undefined reference to
TSHttpTxnHookAdd 的引用'
/tmp/cc5gVORu.o: 在函数 transform_plugin':
bnull-transform.c:(.text+0x54e): undefined reference to
TSHttpTxnReenable 中
/tmp/cc5gVORu.o: 在函数 TSPluginInit':
bnull-transform.c:(.text+0x59c): undefined reference to
TSPluginRegister' 中
bnull-transform.c:(.text+0x5af): 未定义引用 TSError'
bnull-transform.c:(.text+0x5bf): undefined reference to
TSError'
bnull-transform.c:(.text+0x5d2): 未定义对 TSContCreate'
bnull-transform.c:(.text+0x5df): undefined reference to
TSHttpHookAdd 的引用'
collect2:ld 返回 1 退出状态
请帮忙。
您正在尝试将此插件(它是一个 .so)编译为一个独立的应用程序。那行不通的。您应该使用 ATS 安装附带的 tsxs 脚本,例如
tsxs -o null-transform.so null-transform.cc