내 SDL2 프로젝트에서 gl3w에서 벗어나려고 할 때 여러 가지 문제가 발생합니다. 내가 gl3w의 "glAlphaFunc"를 포함하지 않고 SDL_opengl_glext.h를 포함하고 있다는 것을 알았 기 때문에 나는 이것을 고려하고있다.SDL2 및 SDL_opengl_glext.h 정의되지 않은 외부
#define GL_GLEXT_PROTOTYPES
#define GLX_GLEXT_PROTOTYPES
그래서 SDL_opengl_glext.h은 내가 iOS에서처럼 단순히 SDL_opengl.h 및 SDL_opengl_glext.h를 (포함 할 수 어쩌면 생각이 존재 발견 후 : SDL_opengl
내가 다음과 같은 정의 할 필요가 보인다 .h 및 SDL_opengles.h)하지만 이제는 정의되지 않은 외부와 관련된 문제가 발생합니다.
lib 디렉토리 파일 나는 현재 참조하고있어
:; glu32.lib, SDL2.lib, SDL2main.lib, SDL2test.lib, SDL2_image.lib, SDL2_ttf.lib, SDL2_mixer.lib,opengl32.lib libboost_filesystem -vc140-MT-1_58.lib, libboost_system-vc140-MT-1_58.lib, libpq.lib, ssleay32.lib, libeay32.lib; % (AdditionalDependencies)
내 질문은 : SDL2으로 나는 다른 링크 할 수 있습니다 lib 파일을 수정하여 SDL_opengl_glext.h를 올바르게 사용하려면 어떻게해야합니까? 특히이 문제에 대한 명확한 문서는 없습니다. 분출
오류 :
1>emitter.obj : error LNK2019: unresolved external symbol __imp_glBindBuffer referenced in function "protected: virtual void __cdecl MV::Scene::Emitter::defaultDrawImplementation(void)" ([email protected]@[email protected]@@MEAAXXZ)
1>drawable.obj : error LNK2001: unresolved external symbol __imp_glBindBuffer
1>spineMV.obj : error LNK2001: unresolved external symbol __imp_glBindBuffer
1>emitter.obj : error LNK2019: unresolved external symbol __imp_glGenBuffers referenced in function "protected: virtual void __cdecl MV::Scene::Emitter::defaultDrawImplementation(void)" ([email protected]@[email protected]@@MEAAXXZ)
1>drawable.obj : error LNK2001: unresolved external symbol __imp_glGenBuffers
1>spineMV.obj : error LNK2001: unresolved external symbol __imp_glGenBuffers
1>emitter.obj : error LNK2019: unresolved external symbol __imp_glBufferData referenced in function "protected: virtual void __cdecl MV::Scene::Emitter::defaultDrawImplementation(void)" ([email protected]@[email protected]@@MEAAXXZ)
1>drawable.obj : error LNK2001: unresolved external symbol __imp_glBufferData
1>spineMV.obj : error LNK2001: unresolved external symbol __imp_glBufferData
1>emitter.obj : error LNK2019: unresolved external symbol __imp_glDisableVertexAttribArray referenced in function "protected: virtual void __cdecl MV::Scene::Emitter::defaultDrawImplementation(void)" ([email protected]@[email protected]@@MEAAXXZ)
1>drawable.obj : error LNK2001: unresolved external symbol __imp_glDisableVertexAttribArray
1>spineMV.obj : error LNK2001: unresolved external symbol __imp_glDisableVertexAttribArray
1>emitter.obj : error LNK2019: unresolved external symbol __imp_glEnableVertexAttribArray referenced in function "protected: virtual void __cdecl MV::Scene::Emitter::defaultDrawImplementation(void)" ([email protected]@[email protected]@@MEAAXXZ)
1>drawable.obj : error LNK2001: unresolved external symbol __imp_glEnableVertexAttribArray
1>spineMV.obj : error LNK2001: unresolved external symbol __imp_glEnableVertexAttribArray
1>emitter.obj : error LNK2019: unresolved external symbol __imp_glUseProgram referenced in function "protected: virtual void __cdecl MV::Scene::Emitter::defaultDrawImplementation(void)" ([email protected]@[email protected]@@MEAAXXZ)
1>drawable.obj : error LNK2001: unresolved external symbol __imp_glUseProgram
1>spineMV.obj : error LNK2001: unresolved external symbol __imp_glUseProgram
1>emitter.obj : error LNK2019: unresolved external symbol __imp_glVertexAttribPointer referenced in function "protected: virtual void __cdecl MV::Scene::Emitter::defaultDrawImplementation(void)" ([email protected]@[email protected]@@MEAAXXZ)
1>drawable.obj : error LNK2001: unresolved external symbol __imp_glVertexAttribPointer
1>spineMV.obj : error LNK2001: unresolved external symbol __imp_glVertexAttribPointer
1>render.obj : error LNK2019: unresolved external symbol __imp_glActiveTexture referenced in function "public: void __cdecl MV::Shader::set(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::shared_ptr<class MV::TextureDefinition> const &,unsigned int)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@Z)
1>render.obj : error LNK2019: unresolved external symbol __imp_glBlendFuncSeparate referenced in function "public: void __cdecl MV::Draw2D::defaultBlendFunction(void)" ([email protected]@[email protected]@QEAAXXZ)
1>render.obj : error LNK2019: unresolved external symbol __imp_glBlendEquationSeparate referenced in function "public: void __cdecl MV::glExtensionBlendMode::setBlendEquation(unsigned int,unsigned int)" ([email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glAttachShader referenced in function "public: class MV::Shader * __cdecl MV::Draw2D::loadShaderCode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glCompileShader referenced in function "private: void __cdecl MV::Draw2D::loadPartOfShader(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z)
1>render.obj : error LNK2019: unresolved external symbol __imp_glCreateProgram referenced in function "public: class MV::Shader * __cdecl MV::Draw2D::loadShaderCode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glCreateShader referenced in function "public: class MV::Shader * __cdecl MV::Draw2D::loadShaderCode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glGetActiveUniform referenced in function "public: __cdecl MV::Shader::Shader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,bool)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glGetProgramiv referenced in function "public: __cdecl MV::Shader::Shader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,bool)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glGetShaderiv referenced in function "private: void __cdecl MV::Draw2D::validateShaderStatus(unsigned int,bool)" ([email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glGetShaderInfoLog referenced in function "private: void __cdecl MV::Draw2D::validateShaderStatus(unsigned int,bool)" ([email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glGetUniformLocation referenced in function "public: __cdecl MV::Shader::Shader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,bool)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glIsProgram referenced in function "public: __cdecl MV::Shader::Shader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,bool)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glLinkProgram referenced in function "public: class MV::Shader * __cdecl MV::Draw2D::loadShaderCode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glShaderSource referenced in function "private: void __cdecl MV::Draw2D::loadPartOfShader(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z)
1>render.obj : error LNK2019: unresolved external symbol __imp_glUniform1i referenced in function "public: void __cdecl MV::Shader::set(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::shared_ptr<class MV::TextureDefinition> const &,unsigned int)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@Z)
1>render.obj : error LNK2019: unresolved external symbol __imp_glUniform1fv referenced in function "public: void __cdecl MV::Shader::set(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,float)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glUniformMatrix4fv referenced in function "public: void __cdecl MV::Shader::set(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class MV::TransformMatrix const &)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z)
1>render.obj : error LNK2019: unresolved external symbol __imp_glBindRenderbuffer referenced in function "public: void __cdecl MV::glExtensionFramebufferObject::startUsingFramebuffer(class std::weak_ptr<class MV::Framebuffer>,bool)" ([email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glDeleteRenderbuffers referenced in function "public: __cdecl MV::Framebuffer::~Framebuffer(void)" ([email protected]@@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glGenRenderbuffers referenced in function "public: class std::shared_ptr<class MV::Framebuffer> __cdecl MV::glExtensionFramebufferObject::makeFramebuffer(class MV::Point<int> const &,class MV::Size<int> const &,unsigned int,class MV::Color const &)" ([email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@Z)
1>render.obj : error LNK2019: unresolved external symbol __imp_glRenderbufferStorage referenced in function "public: void __cdecl MV::glExtensionFramebufferObject::startUsingFramebuffer(class std::weak_ptr<class MV::Framebuffer>,bool)" ([email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glBindFramebuffer referenced in function "public: void __cdecl MV::glExtensionFramebufferObject::startUsingFramebuffer(class std::weak_ptr<class MV::Framebuffer>,bool)" ([email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glDeleteFramebuffers referenced in function "public: __cdecl MV::Framebuffer::~Framebuffer(void)" ([email protected]@@[email protected])
1>render.obj : error LNK2019: unresolved external symbol __imp_glGenFramebuffers referenced in function "public: class std::shared_ptr<class MV::Framebuffer> __cdecl MV::glExtensionFramebufferObject::makeFramebuffer(class MV::Point<int> const &,class MV::Size<int> const &,unsigned int,class MV::Color const &)" ([email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@Z)
1>render.obj : error LNK2019: unresolved external symbol __imp_glFramebufferTexture2D referenced in function "public: void __cdecl MV::glExtensionFramebufferObject::startUsingFramebuffer(class std::weak_ptr<class MV::Framebuffer>,bool)" ([email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@[email protected])
1>C:\git\MoonDog\x64\Release\M2tMLibrary.exe : fatal error LNK1120: 33 unresolved externals
그래, 나도 알고 있고 gl3w를 OpenGL 로더로 사용하고 있었다. 마치 SDL2에 OpenGL 로더가 포함되어있는 것처럼 보였습니다 (SDL_opengl_glext.h가 그럴 것이라고 생각한 것 같습니다). gl3wInit()과 비슷한 함수 호출이 누락되었을 수 있습니다. 그러나 확실하지 않았다. OpenGL을로드하지 않는 SDL_opengl_glext.h가 무엇인지 알고 있습니까? AlphaFunc에서 머리를 주셔서 감사합니다. 그래서 그냥 그걸 내 쉐이더에 포함시켜야합니다! SDL2에 OpenGL 로더가 없다면 gl3w를 고수 할 것입니다.이 주석을 읽을 기회를 주겠다. 그러나 지금까지 나는 대답을 받아 들일지 모른다. – M2tM
'SDL_opengl.h'와'SDL_opengl_glext.h' 'gl.h'와'glext.h '에 대한 휴대용 대체물이다. 'glext.h' 그 자체는 거의 사용되지 않으며,'GL_GLEXT_PROTOTYPES' 정의는 활성화되어 있습니다 (함수 포인터를위한 타입 정의를 제공하지 않습니다 - 당신 자신의 확장 로더를 작성하는 경우 유용 할 수 있습니다). 나는 여러분이 SDL과 함께 gl3w를 사용하여 매우 다른 것들을 해결할 수 있다고 확신합니다 (SDL + glew도 매우 일반적입니다). GL 함수 로딩의 관점에서 SDL이 제공하는 모든 것은 portable SDL_GL_GetProcAddress이지만 확장 로더를 작성하는 경우에만 다시 관심을 갖습니다. – keltar
감사합니다. 무리가 있으면 혼란이 사라집니다. 내 익스텐션을로드하는 데 몇 년 전에 gl3w로 옮겨서 AlphaFunc가 스텐실 버퍼를 사용하는 예제가 나올 때까지 다시 생각하지 않았으며 그 함수를로드하는 방법을 살펴 보았습니다. (필자는 어쨌든 사용되지 않으므로 쉐이더에서 처리 할 수 있습니다.) 엄청 고마워! – M2tM