3

我正在尝试编译 ACE lib,但编译时出错。

我的 Linux 系统是 Slackware 14.2 64 位

lib是ACE 6.1.4版(我需要编译的版本)

在发布此之前,我已经按照从ACE web构建 ACE 的所有步骤进行操作。

如何编译这个库?

这是错误:

In file included from /home/cyneo/Downloads/ACE_wrappers/ace/OS_NS_Thread.h:32,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Guard_T.h:26,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Free_List.cpp:7,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Free_List.h:142,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Malloc_T.h:26,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Local_Name_Space.h:20,
             from Local_Name_Space.cpp:3:
/home/cyneo/Downloads/ACE_wrappers/ace/os_include/os_sched.h:47:6: error: conflicting declaration ‘typedef struct cpu_set_t cpu_set_t’
} cpu_set_t;
  ^~~~~~~~~

In file included from /usr/include/sched.h:44,
             from /usr/include/pthread.h:23,
             from /home/cyneo/Downloads/ACE_wrappers/ace/os_include/os_pthread.h:51,
             from /home/cyneo/Downloads/ACE_wrappers/ace/OS_NS_Thread.h:31,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Guard_T.h:26,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Free_List.cpp:7,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Free_List.h:142,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Malloc_T.h:26,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Local_Name_Space.h:20,
             from Local_Name_Space.cpp:3:
/usr/include/bits/cpu-set.h:42:3: nota: previous declaration as ‘typedef struct cpu_set_t cpu_set_t’
 } cpu_set_t;

In file included from /home/cyneo/Downloads/ACE_wrappers/ace/TSS_T.h:261,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Singleton.h:24,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Service_Gestalt.h:30,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Service_Object.h:27,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Naming_Context.h:25,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Local_Name_Space_T.h:25,
             from /home/cyneo/Downloads/ACE_wrappers/ace/Local_Name_Space.h:128,
             from Local_Name_Space.cpp:3:
/home/cyneo/Downloads/ACE_wrappers/ace/TSS_T.cpp: En la función miembro ‘void ACE_TSS_Guard<ACE_LOCK>::init_key()’:
/home/cyneo/Downloads/ACE_wrappers/ace/TSS_T.cpp:357:39: error: no matching function for call to ‘ACE_Thread::keycreate(ACE_thread_key_t*, void (*)(void*), void*)’
                      (void *) this);
                                   ^
make[1]: *** [/home/cyneo/Downloads/ACE_wrappers/include/makeinclude/rules.local.GNU:189: .shobj/Local_Name_Space.o] Error 1

我找到了这个,但我无法为我工作:

https://bugs.gentoo.org/638606

https://638606.bugs.gentoo.org/attachment.cgi?id=532828

编辑:

我也尝试编译 ACE 6.5.0,但出现此错误:

during GIMPLE pass: wrestrict
En la función miembro ‘virtual int ACE_Configuration_Heap::open_section(const ACE_Configuration_Section_Key&, const ACE_TCHAR*, int, ACE_Configuration_Section_Key&)’:
en pp_format, en pretty-print.c:1378
ACE_Configuration_Heap::open_section (const ACE_Configuration_Section_Key& base,
4

3 回答 3

4

我对 ACE 有同样的问题,但没有升级它的选项。我设法通过在 ace/config.h 中添加以下内容并重新编译 ACE 来解决冲突的声明问题。

#ifndef __cpu_set_t_defined
#define __cpu_set_t_defined
#endif //!__cpu_set_t_defined

你可能会问为什么这会起作用?好吧,如果您收到此错误,则表示 glibc 已声明cpu_set_t但未定义__cpu_set_t_defined,这是 ACE 所期望的。因此,ACE 也尝试声明cpu_set_t,出现错误。因此,通过定义__cpu_set_t_defined,您告诉 ACE 不要__cpu_set_t_defined再次声明。

但请记住,这只是一种解决方法,只有在您没有更新 ACE 的选项时才应使用。

希望这可以帮助!

于 2018-11-15T12:23:24.730 回答
2

最后,我为 Slackware 14.2 64 位编译了 ACE 6.5.0。它需要在 "ACE_wrappers/include/makeinclude/platform_macros.GNU" 中添加一些参数:

INSTALL_PREFIX=/usr 
INSTALL_LIB=lib64
stl=1
gl=1
ssl=1
buildbits=64
dynamic_loader=1
insure=0
optimize=0
static_stdlibs=0
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
于 2018-07-04T12:09:54.673 回答
0

这个版本的 ACE 很古老,升级到ACE 6.5.0可以解决这个问题。

于 2018-07-04T06:52:30.270 回答