Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/162.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何在linux中静态链接log4cxx_C++_Log4cxx - Fatal编程技术网

C++ 如何在linux中静态链接log4cxx

C++ 如何在linux中静态链接log4cxx,c++,log4cxx,C++,Log4cxx,看起来VisualStudio有一个解决方案#define LOG4CXX_STATIC。Linux中的eclipse如何 这是my的后续问题。定义告诉dumb windows编译器您打算静态链接库。因为在Windows上,编译器非常关心。在Linux上,它们没有,只有链接器有。如果您尝试动态链接它,它将失败,但不会强制静态链接。这也不会影响APR是静态链接还是动态链接。@Jan谢谢你的回复,但我是linux新手。你能举个例子吗?我没说过Linux。我只是说,您为Windows引用的“解决方案”

看起来VisualStudio有一个解决方案#define LOG4CXX_STATIC。Linux中的eclipse如何


这是my

的后续问题。定义告诉dumb windows编译器您打算静态链接库。因为在Windows上,编译器非常关心。在Linux上,它们没有,只有链接器有。如果您尝试动态链接它,它将失败,但不会强制静态链接。这也不会影响APR是静态链接还是动态链接。@Jan谢谢你的回复,但我是linux新手。你能举个例子吗?我没说过Linux。我只是说,您为Windows引用的“解决方案”根本不是任何问题的解决方案!您必须获得预编译的静态库,或者自己编译(log4cxx网站上有说明)。然后可以使用-l选项将其链接到gcc/g++