gpt4 book ai didi

c++ - 在 OpenGL ES 示例中找不到 "esUtil.h"

转载 作者:太空宇宙 更新时间:2023-11-04 13:07:03 25 4
gpt4 key购买 nike

在学习了 OpenGL 的一些基础知识后,我开始研究 OpenGL ES API。我正在尝试使用此示例在 OpenGL ES 中绘制三角形:https://www.khronos.org/assets/uploads/books/openglr_es_20_programming_guide_sample.pdf .

在代码中,作者包含文件“esUtil.h”,但我无法从任何官方来源找到它。我试图用 EGL 和 GLES 3 库复制谷歌上某个项目的“esUtil.h”文件,但程序仍然根本无法运行。帮帮我,我错过了什么?

这些是我在构建解决方案时遇到的错误:

Severity    Code    Description Project File    Line    Suppression State
Error LNK2019 unresolved external symbol __imp__glAttachShader@8 referenced in function "int __cdecl Init(struct ESContext *)" (?Init@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glCompileShader@4 referenced in function "unsigned int __cdecl LoadShader(unsigned int,char const *)" (?LoadShader@@YAIIPBD@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glCreateProgram@0 referenced in function "int __cdecl Init(struct ESContext *)" (?Init@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glCreateShader@4 referenced in function "unsigned int __cdecl LoadShader(unsigned int,char const *)" (?LoadShader@@YAIIPBD@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glDeleteProgram@4 referenced in function "int __cdecl Init(struct ESContext *)" (?Init@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glDeleteShader@4 referenced in function "unsigned int __cdecl LoadShader(unsigned int,char const *)" (?LoadShader@@YAIIPBD@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glEnableVertexAttribArray@4 referenced in function "void __cdecl Draw(struct ESContext *)" (?Draw@@YAXPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glGetProgramiv@12 referenced in function "int __cdecl Init(struct ESContext *)" (?Init@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glGetProgramInfoLog@16 referenced in function "int __cdecl Init(struct ESContext *)" (?Init@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glGetShaderiv@12 referenced in function "unsigned int __cdecl LoadShader(unsigned int,char const *)" (?LoadShader@@YAIIPBD@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glGetShaderInfoLog@16 referenced in function "unsigned int __cdecl LoadShader(unsigned int,char const *)" (?LoadShader@@YAIIPBD@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glLinkProgram@4 referenced in function "int __cdecl Init(struct ESContext *)" (?Init@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glShaderSource@16 referenced in function "unsigned int __cdecl LoadShader(unsigned int,char const *)" (?LoadShader@@YAIIPBD@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glUseProgram@4 referenced in function "void __cdecl Draw(struct ESContext *)" (?Draw@@YAXPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol __imp__glVertexAttribPointer@24 referenced in function "void __cdecl Draw(struct ESContext *)" (?Draw@@YAXPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol _esCreateWindow referenced in function "int __cdecl esMain(struct ESContext *)" (?esMain@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol _esRegisterDrawFunc referenced in function "int __cdecl esMain(struct ESContext *)" (?esMain@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol _esRegisterShutdownFunc referenced in function "int __cdecl esMain(struct ESContext *)" (?esMain@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol _esLogMessage referenced in function "int __cdecl Init(struct ESContext *)" (?Init@@YAHPAUESContext@@@Z) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\Source.obj 1
Error LNK2019 unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\OpenGLES_Example\MSVCRTD.lib(exe_main.obj) 1
Error LNK1120 20 unresolved externals OpenGLES_Example D:\WorkSpace\Visual Studio\myOpenGLSamples\Debug\OpenGLES_Example.exe 1

最佳答案

这些错误不是包含文件的问题,而是链接的问题。这些符号表示您缺少 OpenGL ES 库(glAttachShader 等),以及示例代码中的一些函数(似乎来自 esUtil.c)。

如果您点击教程中的下载链接,它们会指向 here .您可能会考虑只克隆 git 存储库,然后使用它。至少,esUtil.h文件在下面,你还需要编译esUtil.c到你的项目中,因为其中一些符号丢失了。

关于c++ - 在 OpenGL ES 示例中找不到 "esUtil.h",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41733213/

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