gpt4 book ai didi

c++ - 编译时 OpenGL GLI 错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:57:55 28 4
gpt4 key购买 nike

当我尝试使用 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’

最佳答案

我认为问题在于您没有告诉编译器您需要使用 C++11 标准进行编译。

如果你使用的是 gcc 那么你必须通过

-std=c++11

在你的命令行上(或者 -std=c++0x 如果你使用的是旧版本的 gcc)

关于c++ - 编译时 OpenGL GLI 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15291392/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com