我尝试编译这样的代码(linux ubuntu,boost 1.49):
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/containers/vector.hpp>
int main(int argc, char** argv) {
return 0;
}
它不再为我编译。错误列表在这里(抱歉一些不重要的波兰语):
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Wejście do katalogu `/home/irol/NetBeansProjects/shMemTst2'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/shmemtst2
make[2]: Wejście do katalogu `/home/irol/NetBeansProjects/shMemTst2'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/Main.o.d
g++ -c -g -MMD -MP -MF build/Debug/GNU-Linux-x86/Main.o.d -o build/Debug/GNU-Linux-x86/Main.o Main.cpp
In file included from /usr/local/include/boost/interprocess/containers/containers_fwd.hpp:25:0,
from /usr/local/include/boost/interprocess/containers/vector.hpp:20,
from Main.cpp:3:
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:63:7: error: redefinition of default argument for ‘class A’
/usr/local/include/boost/container/container_fwd.hpp:52:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:68:7: error: redefinition of default argument for ‘class A’
/usr/local/include/boost/container/container_fwd.hpp:57:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:73:7: error: redefinition of default argument for ‘class A’
/usr/local/include/boost/container/container_fwd.hpp:62:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:78:7: error: redefinition of default argument for ‘class A’
/usr/local/include/boost/container/container_fwd.hpp:67:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:83:7: error: redefinition of default argument for ‘class Alloc’
/usr/local/include/boost/container/container_fwd.hpp:72:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:89:7: error: redefinition of default argument for ‘class Pred’
/usr/local/include/boost/container/container_fwd.hpp:77:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:95:7: error: redefinition of default argument for ‘class Pred’
/usr/local/include/boost/container/container_fwd.hpp:83:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:102:7: error: redefinition of default argument for ‘class Pred’
/usr/local/include/boost/container/container_fwd.hpp:90:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:109:7: error: redefinition of default argument for ‘class Pred’
/usr/local/include/boost/container/container_fwd.hpp:97:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:115:7: error: redefinition of default argument for ‘class Pred’
/usr/local/include/boost/container/container_fwd.hpp:103:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:121:7: error: redefinition of default argument for ‘class Pred’
/usr/local/include/boost/container/container_fwd.hpp:109:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:128:7: error: redefinition of default argument for ‘class Pred’
/usr/local/include/boost/container/container_fwd.hpp:116:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:135:7: error: redefinition of default argument for ‘class Pred’
/usr/local/include/boost/container/container_fwd.hpp:123:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:141:7: error: redefinition of default argument for ‘class Traits’
/usr/local/include/boost/container/container_fwd.hpp:129:11: note: original definition appeared here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:145:8: error: redefinition of ‘struct boost::container::ordered_range_impl_t’
/usr/local/include/boost/container/container_fwd.hpp:135:29: error: previous definition of ‘struct boost::container::ordered_range_impl_t’
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:149:8: error: redefinition of ‘struct boost::container::ordered_unique_range_impl_t’
/usr/local/include/boost/container/container_fwd.hpp:139:35: error: previous definition of ‘struct boost::container::ordered_unique_range_impl_t’
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:160:30: error: redefinition of ‘boost::container::ordered_range_impl_t* const boost::container::ordered_range’
/usr/local/include/boost/container/container_fwd.hpp:150:30: error: ‘boost::container::ordered_range_impl_t* const boost::container::ordered_range’ previously defined here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:164:37: error: redefinition of ‘boost::container::ordered_unique_range_impl_t* const boost::container::ordered_unique_range’
/usr/local/include/boost/container/container_fwd.hpp:154:37: error: ‘boost::container::ordered_unique_range_impl_t* const boost::container::ordered_unique_range’ previously defined here
/usr/local/include/boost/interprocess/containers/container/container_fwd.hpp:172:8: error: redefinition of ‘struct boost::container::detail_really_deep_namespace::dummy’
/usr/local/include/boost/container/container_fwd.hpp:163:1: error: previous definition of ‘struct boost::container::detail_really_deep_namespace::dummy’
make[2]: *** [build/Debug/GNU-Linux-x86/Main.o] Błąd 1
make[2]: Opuszczenie katalogu `/home/irol/NetBeansProjects/shMemTst2'
make[1]: *** [.build-conf] Błąd 2
make[1]: Opuszczenie katalogu `/home/irol/NetBeansProjects/shMemTst2'
make: *** [.build-impl] Błąd 2
BUILD FAILED (exit value 2, total time: 3s)
提升1.49是否有错误的版本?