首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

ACE 有关问题,很多头文件找不到

2012-03-27 
ACE 问题,很多头文件找不到,Linux环境下,代码中调用了ACE,但在编译时,报了一堆错误头文件找不到的错误。我A

ACE 问题,很多头文件找不到,
Linux环境下,代码中调用了ACE,但在编译时,报了一堆错误头文件找不到的错误。我ACE的刚下载6.0版本的,查看这些头文件确实没有,现在怎么办呢,请大侠们指教。


In file included from ../../ACE_wrappers/ace/config-lite.h:24,
  from ../../ACE_wrappers/ace/ACE_export.h:11,
  from ../../ACE_wrappers/ace/Sock_Connect.h:19,
  from ../../ACE_wrappers/ace/INET_Addr.h:17,
  from key.cpp:5:
../../ACE_wrappers/ace/config-macros.h:24:24: error: ace/config.h: 没有那个文件或目录
In file included from ../../ACE_wrappers/ace/Flag_Manip.h:26,
  from ../../ACE_wrappers/ace/IPC_SAP.h:17,
  from ../../ACE_wrappers/ace/SOCK.h:24,
  from ../../ACE_wrappers/ace/SOCK_IO.h:18,
  from ../../ACE_wrappers/ace/SOCK_Stream.h:17,
  from ../../ACE_wrappers/ace/SOCK_Connector.h:17,
  from key.cpp:6:
../../ACE_wrappers/ace/Global_Macros.h:914:26: error: new.h: 没有那个文件或目录
In file included from ../../ACE_wrappers/ace/os_include/os_signal.h:213,
  from ../../ACE_wrappers/ace/os_include/sys/os_wait.h:27,
  from ../../ACE_wrappers/ace/os_include/os_stdlib.h:28,
  from ../../ACE_wrappers/ace/Basic_Types.h:59,
  from ../../ACE_wrappers/ace/Sock_Connect.h:25,
  from ../../ACE_wrappers/ace/INET_Addr.h:17,
  from key.cpp:5:
../../ACE_wrappers/ace/os_include/os_ucontext.h:40: error: conflicting declaration ‘typedef int ucontext_t’
/usr/include/sys/ucontext.h:244: error: ‘ucontext_t’ has a previous declaration as ‘typedef struct ucontext ucontext_t’
In file included from ../../ACE_wrappers/ace/os_include/netinet/os_in.h:29,
  from ../../ACE_wrappers/ace/Sock_Connect.h:26,
  from ../../ACE_wrappers/ace/INET_Addr.h:17,
  from key.cpp:5:
../../ACE_wrappers/ace/os_include/sys/os_socket.h:44: error: redefinition of ‘struct msghdr’
/usr/include/bits/socket.h:246: error: previous definition of ‘struct msghdr’
In file included from ../../ACE_wrappers/ace/OS_NS_stropts.h:32,
  from ../../ACE_wrappers/ace/SOCK.h:25,
  from ../../ACE_wrappers/ace/SOCK_IO.h:18,
  from ../../ACE_wrappers/ace/SOCK_Stream.h:17,
  from ../../ACE_wrappers/ace/SOCK_Connector.h:17,
  from key.cpp:6:
../../ACE_wrappers/ace/os_include/os_stropts.h:93: error: redefinition of ‘struct strbuf’
/usr/include/bits/stropts.h:181: error: previous definition of ‘struct strbuf’
In file included from ../../ACE_wrappers/ace/os_include/os_sched.h:27,
  from ../../ACE_wrappers/ace/OS_NS_Thread.h:32,
  from ../../ACE_wrappers/ace/Guard_T.h:26,
  from key.cpp:7:
../../ACE_wrappers/ace/os_include/os_time.h:58: error: redefinition of ‘struct timespec’
/usr/include/time.h:121: error: previous definition of ‘struct timespec’
../../ACE_wrappers/ace/os_include/os_time.h:64: error: invalid type in declaration before ‘;’ token
In file included from ../../ACE_wrappers/ace/OS_NS_Thread.h:32,
  from ../../ACE_wrappers/ace/Guard_T.h:26,
  from key.cpp:7:
../../ACE_wrappers/ace/os_include/os_sched.h:47: error: conflicting declaration ‘typedef struct cpu_set_t cpu_set_t’
/usr/include/bits/sched.h:123: error: ‘cpu_set_t’ has a previous declaration as ‘typedef struct cpu_set_t cpu_set_t’
In file included from ../../ACE_wrappers/ace/Base_Thread_Adapter.h:17,
  from ../../ACE_wrappers/ace/OS_NS_Thread.h:33,
  from ../../ACE_wrappers/ace/Guard_T.h:26,
  from key.cpp:7:
../../ACE_wrappers/ace/OS_Log_Msg_Attributes.h:53: error: reference to ‘ostream’ is ambiguous


../../ACE_wrappers/ace/iosfwd.h:87: error: candidates are: struct ostream
/usr/include/c++/4.4/iosfwd:130: error: typedef struct std::basic_ostream<char, std::char_traits<char> > std::ostream
../../ACE_wrappers/ace/OS_Log_Msg_Attributes.h:53: error: ISO C++ forbids declaration of ‘ostream’ with no type
../../ACE_wrappers/ace/OS_Log_Msg_Attributes.h:53: error: expected ‘;’ before ‘*’ token
In file included from ../../ACE_wrappers/ace/OS_NS_Thread.h:37,
  from ../../ACE_wrappers/ace/Guard_T.h:26,
  from key.cpp:7:

[解决办法]
export ACE_ROOT=$HOME/ACE_wrappers
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACE_ROOT/ace:$ACE_ROOT/lib
cd ~/ACE_wrappers
gmake --ver
检查GNU Make version 3.79.1
vi ace/config.h
按i进入插入模式修改
#include "ace/config-linux.h"
按Esc键退出插入模式
:wq
vi include/makeinclude/platform_macros.GNU
按i进入插入模式修改
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
按Esc键退出插入模式
:wq
cd ace
make

热点排行