2

gli / gli.hppでコンパイルしようとすると、次のエラーが発生します。私はこれまでそれらのファイルに触れたことがありません。だから私は問題を解決する方法がわかりません。

In file included from /usr/include/gli/gli.hpp:42:0,
              from window.cpp:4:
/usr/include/gli/./core/storage.hpp:89:25: error: declaration of ‘gli::storage::format_type gli::storage::format() const’ [-fpermissive]
/usr/include/gli/./core/format.hpp:36:8: error: changes meaning of ‘format’ from ‘enum gli::format’ [-fpermissive]

In file included from /usr/include/gli/gli.hpp:45:0,
              from window.cpp:4:
/usr/include/gli/./core/texture2d.hpp:71:24: error: declaration of ‘gli::texture2D::format_type gli::texture2D::format() const’ [-fpermissive]
/usr/include/gli/./core/format.hpp:36:8: error: changes meaning of ‘format’ from ‘enum gli::format’ [-fpermissive]

In file included from /usr/include/gli/gli.hpp:46:0
             from window.cpp:4:
/usr/include/gli/./core/texture2d_array.hpp:72:24: error: declaration of ‘gli::texture2DArray::format_type gli::texture2DArray::format() const’ [-fpermissive]
/usr/include/gli/./core/format.hpp:36:8: error: changes meaning of ‘format’ from ‘enum gli::format’ [-fpermissive]

In file included from /usr/include/gli/gli.hpp:47:0,
             from window.cpp:4:
/usr/include/gli/./core/texture3d.hpp:71:24: error: declaration of ‘gli::texture3D::format_type gli::texture3D::format() const’ [-fpermissive]
/usr/include/gli/./core/format.hpp:36:8: error: changes meaning of ‘format’ from ‘enum gli::format’ [-fpermissive]

In file included from /usr/include/gli/gli.hpp:51:0,
             from window.cpp:4:
/usr/include/gli/./core/load_dds.hpp:37:3: error: ‘string’ is not a member of ‘std’

In file included from /usr/include/gli/./core/load_dds.hpp:41:0,
             from /usr/include/gli/gli.hpp:51,
             from window.cpp:4:
/usr/include/gli/./core/load_dds.inl: In function ‘gli::storage gli::loadStorageDDS(const string&)’:
/usr/include/gli/./core/load_dds.inl:303:1: error: ‘gli::storage gli::loadStorageDDS(const string&)’ redeclared as different kind of symbol
/usr/include/gli/./core/load_dds.hpp:36:10: error: previous declaration of ‘gli::storage gli::loadStorageDDS’
4

2 に答える 2

0

簡単に言えば、C++コンパイラはgliの開発に使用されるコンパイラよりも厳密であるように見えます。-fpermissiveエラーを確認すると、行を追加することで最初のエラーを消音できます(必ずしも適切に修正されるとは限りません)g++。このエラーは、で間違ったリターンタイプを使用したことが原因のようです。gli::storage::format()

In file included from /usr/include/gli/gli.hpp:42:0,
              from window.cpp:4:
/usr/include/gli/./core/storage.hpp:89:25: error: declaration of ‘gli::storage::format_type gli::storage::format() const’ [-fpermissive]
/usr/include/gli/./core/format.hpp:36:8: error: changes meaning of ‘format’ from ‘enum gli::format’ [-fpermissive]

In file included from /usr/include/gli/gli.hpp:45:0,
              from window.cpp:4:
/usr/include/gli/./core/texture2d.hpp:71:24: error: declaration of ‘gli::texture2D::format_type gli::texture2D::format() const’ [-fpermissive]
/usr/include/gli/./core/format.hpp:36:8: error: changes meaning of ‘format’ from ‘enum gli::format’ [-fpermissive]

In file included from /usr/include/gli/gli.hpp:46:0
             from window.cpp:4:
/usr/include/gli/./core/texture2d_array.hpp:72:24: error: declaration of ‘gli::texture2DArray::format_type gli::texture2DArray::format() const’ [-fpermissive]
/usr/include/gli/./core/format.hpp:36:8: error: changes meaning of ‘format’ from ‘enum gli::format’ [-fpermissive]

In file included from /usr/include/gli/gli.hpp:47:0,
             from window.cpp:4:
/usr/include/gli/./core/texture3d.hpp:71:24: error: declaration of ‘gli::texture3D::format_type gli::texture3D::format() const’ [-fpermissive]
/usr/include/gli/./core/format.hpp:36:8: error: changes meaning of ‘format’ from ‘enum gli::format’ [-fpermissive]

次のエラーは、間違ったヘッダーファイルがインクルードされている場合のようです。特に、C ++が宣言する場所である、ではなく、をload_dds.hpp含む別のヘッダーファイル(storage.hpp)をインクルードします。簡単な修正は、ダウンロードしたコピーに追加して、バグを報告することです。<cstring><string>std::string<string>storage.hpp

In file included from /usr/include/gli/gli.hpp:51:0,
             from window.cpp:4:
/usr/include/gli/./core/load_dds.hpp:37:3: error: ‘string’ is not a member of ‘std’

これについては、問題はload_dds.hppgli::loadStorageDDSが関数として削除されているが、であるとラベル付けされていないinlineことであると私は信じていload_dds.inlます。このメカニズムはMicrosoftの調合のようなもののように見えるため、一貫性を保つために実装を含めるように.inl変更する必要がある場合があります。(それは推測です、ところで)。.hpp.inl

In file included from /usr/include/gli/./core/load_dds.hpp:41:0,
             from /usr/include/gli/gli.hpp:51,
             from window.cpp:4:
/usr/include/gli/./core/load_dds.inl: In function ‘gli::storage gli::loadStorageDDS(const string&)’:
/usr/include/gli/./core/load_dds.inl:303:1: error: ‘gli::storage gli::loadStorageDDS(const string&)’ redeclared as different kind of symbol
/usr/include/gli/./core/load_dds.hpp:36:10: error: previous declaration of ‘gli::storage gli::loadStorageDDS’
于 2013-03-08T16:24:47.367 に答える
0

問題は、C++11標準を使用してコンパイルする必要があることをコンパイラーに伝えていないことだと思います。

gccを使用している場合は、合格する必要があります

-std=c++11

コマンドラインで(または、古いバージョンのgccを使用している場合は-std = c ++ 0x)

于 2013-04-04T03:56:38.613 に答える