使用CentOS 6编译ACE / TAO 1.2库

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用CentOS 6编译ACE / TAO 1.2库相关的知识,希望对你有一定的参考价值。

我在64位CentOS 6.7机器上使用g ++ 4.4.7,我正在尝试编译用g ++ 2.96编译的ACE TAO library 1.2

当我尝试使用g ++版本4.4.7进行编译时,我得到以下错误(更完整的输出here

g++ -W -Wall -Wpointer-arith -pipe -O3 -g -Wno-uninitialized -fno-implicit-templates   -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_REENTRANT   -I/home/oscarpelaoo/Downloads/ACE_wrappers -DACE_HAS_EXCEPTIONS  -c -fPIC -o .shobj/URL_Addr.o URL_Addr.cpp
In file included from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/ACE.h:17,
                 from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/INET_Addr.h:17,
                 from URL_Addr.h:20,
                 from URL_Addr.cpp:3:
/home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS.h:3110:27: error: new.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward/strstream:47,
                 from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/streams.h:70,
                 from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS.h:3197,
                 from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/ACE.h:17,
                 from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/INET_Addr.h:17,
                 from URL_Addr.h:20,
                 from URL_Addr.cpp:3:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
In file included from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS_TLI.h:191,
                 from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS.h:38,
                 from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/ACE.h:17,
                 from /home/oscarpelaoo/Downloads/ACE_wrappers/ace/INET_Addr.h:17,
                 from URL_Addr.h:20,
                 from URL_Addr.cpp:3:
/home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS_TLI.inl: In static member function ‘static int ACE_OS_TLI::t_accept(ACE_HANDLE, ACE_HANDLE, t_call*)’:
/home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS_TLI.inl:12: warning: the address of ‘call’ will never be NULL
/home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS_TLI.inl:13: warning: the address of ‘reshandle’ will never be NULL
/home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS_TLI.inl:14: warning: the address of ‘handle’ will never be NULL
/home/oscarpelaoo/Downloads/ACE_wrappers/ace/OS_TLI.inl: In static member function ‘static char* ACE_OS_TLI::t_alloc(ACE_HANDLE, int, int)’:

经过一番研究,我发现Red Hat为CentOS 6 here提供了一些旧的libstdc ++库。

是否可以使用旧版本的g ++ 2.96,我不相信它有64位支持,或者我可以以某种方式使用兼容性工具与g ++ 4.4.7尝试使某些事情发生?

答案

自从我能够安装它以来回答我自己的帖子。

安装相关的32位库后,需要添加-m32标志。然后我们需要添加一个-DACE_LACKS_NEW_H标志,因为我的系统不包含<new.h>文件。之后我只需要添加一个前向声明和编译的库。

以上是关于使用CentOS 6编译ACE / TAO 1.2库的主要内容,如果未能解决你的问题,请参考以下文章

ACE_TAO 002

ACE_TAO 003

ACE_TAO 013 ACE_NEW_RETURN

ACE_TAO 013 ACE_NEW_RETURN

TAO+ACE ROOTPOA

ACE_TAO 005