我正在尝试编译ACE库,但在编译时出错。
我的Linux系统是Slackware 14.264位
库是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,发布于 2018-11-15 20:23:25
我的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-07-04 20:09:55
最后,我编译了适用于Slackware 14.264位的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-04 14:52:30
这个版本的ACE是旧的,升级到ACE 6.5.0可以解决这个问题。
https://stackoverflow.com/questions/51156629
复制相似问题