[英]Compiling error with ACE lib on Slackware 14.2 64 bit
我正在嘗試編譯ACE lib,但我編譯錯誤。
我的Linux系統是Slackware 14.2 64位
lib是ACE版本6.1.4(我需要編譯的版本)
在發布之前,我已經遵循了從ACE Web構建ACE的所有步驟。
如何編譯這個lib?
這是錯誤:
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,
我遇到了與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時才應使用。
希望這可以幫助!
最后我為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
這個版本的ACE很古老,升級到ACE 6.5.0修復了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.