2011-10-04 75 views
1

我一直在使用升壓序列化時編譯錯誤,我開發了一個整個模塊存儲類持久性存儲,但是當我嘗試我的模塊遷移到其他項目中,我得到了一些錯誤,我有從未見過,我沒有在網上找到任何相關信息。助推「is_virtual_base_of」遷移工作模塊

我得到的錯誤是:

In file included from support.../boost_1_44/boost/serialization/void_cast.hpp:29, 
       from support.../boost_1_44/boost/archive/detail/oserializer.hpp:57, 
       from support.../boost_1_44/boost/archive/detail/interface_oarchive.hpp:23, 
       from support.../boost_1_44/boost/archive/detail/common_oarchive.hpp:22, 
       from support.../boost_1_44/boost/archive/basic_binary_oarchive.hpp:34, 
       from support.../boost_1_44/boost/archive/binary_oarchive_impl.hpp:23, 
       from support.../boost_1_44/boost/archive/binary_oarchive.hpp:21, 
       from .../ps_proxy.h:54, 

support.../boost_1_44/boost/type_traits/is_virtual_base_of.hpp:57:10: error: macro "X" requires 2 arguments, but only 1 given 
support.../boost_1_44/boost/type_traits/is_virtual_base_of.hpp:58:18: error: macro "X" requires 2 arguments, but only 1 given 
support.../boost_1_44/boost/type_traits/is_virtual_base_of.hpp:60:11: error: macro "X" requires 2 arguments, but only 1 given 
support.../boost_1_44/boost/type_traits/is_virtual_base_of.hpp:57: error: declaration does not declare anything 
support.../boost_1_44/boost/type_traits/is_virtual_base_of.hpp:58: error: declaration does not declare anything 
support.../boost_1_44/boost/type_traits/is_virtual_base_of.hpp:60: error: declaration of '~boost::detail::is_virtual_base_of_impl<Base, Derived, mpl_::bool_<true> >::X' as non-function 
support.../boost_1_44/boost/type_traits/is_virtual_base_of.hpp:60: error: expected ';' before 'throw' 

我希望有人可以給我關於爲什麼這可能happend,爲什麼它工作正常在一個模塊上,當我遷移它(應該是透明的遷移)一些小費它會拋出這些錯誤。

謝謝!

回答

2
  1. boost::is_virtual_base_of<>在執行Boost.Serialization的某處使用。
  2. 在升壓1.44,boost::is_virtual_base_of<>使用的類型命名爲XY實施詳情。
  3. 在您的其他項目中的某個地方,定義了一個名爲X的宏,打破了在執行boost::is_virtual_base_of<>時使用的X類型。

顯然X是一個可怕的宏名 - 如果這是你再找到一個更好的名字,如果它不是那麼電子郵件whatever庫的提交人將其定義和(包括任何Boost頭前,然後#undef吧)抱怨。

FWIW,這顯然是一個共同的問題,足以在加速1.47類型的命名boost_type_traits_internal_struct_Xboost_type_traits_internal_struct_Y來代替XY,因此升級到加速的一個更新版本的另一種方式來解決你的症狀。

+0

謝謝!這是德的問題,我會與宏觀筆者抱怨:P。現在我可以整合我的模塊:-) – Maraku