2016-05-27 8 views
0

Alderbaran Nao V5ロボットで作業しています。さらに、私はバーチャルボックス内でAlderbaranが提供する仮想環境で自分のコードをコンパイルしています。私はC++ 11からの機能に依存している私のコンピュータ上でコードを書かれているプロジェクトが古いC++でコンパイルされた.soライブラリに依存する場合のC++ 11でのコンパイル

は(マルチスレッドと匿名関数)が、しかし、VMにインストールされているG ++コンパイラは、次のとおりです。

Using built-in specs. 
COLLECT_GCC=/usr/i686-pc-linux-gnu/gcc-bin/4.5.3/g++ 
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-linux-gnu/4.5.3/lto-wrapper 
Target: i686-pc-linux-gnu 
Configured with: /opennao-atom/tmp/portage/sys-devel/gcc-4.5.3-r1/work/gcc-4.5.3/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.5.3 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.5.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.5.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.5.3/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/i686-pc-linux-gnu/4.5.3/python --enable-checking=release --disable-libgcj --with-arch=i686 --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.3-r1 p1.0, pie-0.4.5' 
Thread model: posix 
gcc version 4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) 

マルチスレッディングと無名関数ので、プロトタイプの-std = C++ 0xフラグを指定すると、C++ 0xを有効にしてコンパイルを試みました。しかし、次のエラーメッセージが表示されます。これは、自分のコードで活用しているAlderbaranライブラリが、以前のC++バージョンで指定されたルールに準拠しているためです。誰もがソリューションをお勧めできますか?それらのAlderbaranライブラリの下位互換性を使用する方法はありますか?新しいコンパイラを自分のコードで使用する方法はありますか?

g++ -Wall -g -fPIC -std=c++0x -c -I/home/nao/naoqi-sdk-2.1.3.3-linux32/include StepHandler.cpp 
In file included from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodule.h:17:0, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alproxy.h:16, 
       from StepHandler.h:16, 
       from StepHandler.cpp:6: 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/boost/signal.hpp:17:4: warning: #warning "Boost.Signals is no longer being maintained and is now deprecated. Please switch to Boost.Signals2. To disable this warning message, define BOOST_SIGNALS_NO_DEPRECATION_WARNING." 
In file included from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodulecore.h:17:0, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodule.h:16, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alproxy.h:16, 
       from StepHandler.h:16, 
       from StepHandler.cpp:6: 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/boost/noncopyable.hpp:27:37: error: 'boost::noncopyable_::noncopyable::noncopyable()' declared with non-public access cannot be defaulted in the class body 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/boost/noncopyable.hpp:28:22: error: 'boost::noncopyable_::noncopyable::~noncopyable()' declared with non-public access cannot be defaulted in the class body 
In file included from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/typeinterface.hpp:371:0, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyfunction.hpp:53, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/manageable.hpp:13, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyobject.hpp:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alfunctor.h:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodulecore.h:21, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodule.h:16, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alproxy.h:16, 
       from StepHandler.h:16, 
       from StepHandler.cpp:6: 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/typeimpl.hxx: In static member function 'static void* qi::TypeByPointer<T, Manager>::initializeStorage(void*)': 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/typeimpl.hxx:157:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/typeimpl.hxx:157:1: error: expected primary-expression before '(' token 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/typeimpl.hxx:157:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/typeimpl.hxx:157:1: error: expected primary-expression before ')' token 
In file included from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/typeinterface.hpp:372:0, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyfunction.hpp:53, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/manageable.hpp:13, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyobject.hpp:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alfunctor.h:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodulecore.h:21, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodule.h:16, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alproxy.h:16, 
       from StepHandler.h:16, 
       from StepHandler.cpp:6: 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/type.hxx: In function 'void qi::detail::initializeType(qi::TypeInterface*&)': 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/type.hxx:46:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/type.hxx:46:1: error: expected primary-expression before '(' token 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/type.hxx:46:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/type.hxx:46:1: error: expected primary-expression before ')' token 
In file included from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/typeinterface.hpp:376:0, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyfunction.hpp:53, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/manageable.hpp:13, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyobject.hpp:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alfunctor.h:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodulecore.h:21, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodule.h:16, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alproxy.h:16, 
       from StepHandler.h:16, 
       from StepHandler.cpp:6: 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/stringtypeinterface.hxx: In member function 'virtual void qi::TypeImpl<char [I]>::set(void**, const char*, size_t)': 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/stringtypeinterface.hxx:104:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/stringtypeinterface.hxx:104:1: error: expected primary-expression before '(' token 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/stringtypeinterface.hxx:104:1: error: expected primary-expression before ',' token 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/stringtypeinterface.hxx:104:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/stringtypeinterface.hxx:104:1: error: expected primary-expression before ')' token 
In file included from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/typeinterface.hpp:380:0, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyfunction.hpp:53, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/manageable.hpp:13, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyobject.hpp:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alfunctor.h:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodulecore.h:21, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodule.h:16, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alproxy.h:16, 
       from StepHandler.h:16, 
       from StepHandler.cpp:6: 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx: In member function 'virtual qi::AnyReference qi::TypeImpl<boost::any>::get(void*)': 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx:20:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx:20:1: error: expected primary-expression before '(' token 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx:20:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx:20:1: error: expected primary-expression before ')' token 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx: In member function 'virtual void qi::TypeImpl<boost::any>::set(void**, qi::AnyReference)': 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx:26:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx:26:1: error: expected primary-expression before '(' token 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx:26:1: error: too few arguments to function 'boost::format qi::log::detail::getFormat(const std::string&)' 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qi/details/log.hxx:201:28: note: declared here 
/home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/details/dynamictypeinterface.hxx:26:1: error: expected primary-expression before ')' token 
In file included from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyfunction.hpp:228:0, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/manageable.hpp:13, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/qitype/anyobject.hpp:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alfunctor.h:17, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodulecore.h:21, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/almodule.h:16, 
       from /home/nao/naoqi-sdk-2.1.3.3-linux32/include/alcommon/alproxy.h:16, 
       from StepHandler.h:16, 
       from StepHandler.cpp:6: 

など

+0

'/home/nao/naoqi-sdk-2.1.3.3-linux32/include/boost/noncopyable.hpp:27:37:エラー: 'boost :: noncopyable _ :: noncopyable :: noncopyable()'がnonと宣言されています-publicアクセスをクラス本体でデフォルトにすることはできません。これはC++ 11のコードがあまりにも古い標準でコンパイルされているように聞こえますか? –

+0

あなたが期待する解決策は不明です。コンパイラに合わせてすべてのコードをコンパイルする必要があります.C++には標準のABIがありませんので、複数のC++コンパイラ/バージョンを混在させて使用するのは、通常かなり難しいです。 –

答えて

1

同様の質問がここで見つけることができます:Can you mix c++ compiled with different versions of the same compiler

最も安全なソリューションは、アプリケーション・コードとライブラリの両方に同じコンパイラのバージョンを使用することです。これは、使用しているすべてのライブラリを新しいコンパイラバージョンで再コンパイルすることを意味します。

0

NAOの場合、仮想マシンを使用せずにC++をクロスコンパイルすることもできますので、必要なコンパイラのバージョンを使用できます。

関連する問題