Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2.3.1 Linker Errors in CodeBlocks GCC 4.9.2 MinGW (SEH) - 64-bi  (Read 1348 times)

0 Members and 1 Guest are viewing this topic.

Manu94

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Hi , I am trying to get SFML 2.3.1 to get working with codeblocks to no avail. It would be great if someone could help me with this issue.
I have the right gcc versions, sfml binaries and it still throws linker errors, though im linking the required dependencies
Errors:
||=== Build: Debug in Cronos2D (compiler: GNU GCC Compiler) ===|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderTarget.cpp.obj)||In function `sf::RenderTarget::clear(sf::Color const&)':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|97|undefined reference to `glClearColor'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|98|undefined reference to `glClear'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderTarget.cpp.obj)||In function `sf::RenderTarget::draw(sf::Vertex const*, unsigned long long, sf::PrimitiveType, sf::RenderStates const&)':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|267|undefined reference to `glVertexPointer'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|268|undefined reference to `glColorPointer'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|269|undefined reference to `glTexCoordPointer'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|278|undefined reference to `glDrawArrays'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderTarget.cpp.obj)||In function `sf::RenderTarget::pushGLStates()':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|297|undefined reference to `glGetError'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|307|undefined reference to `glPushClientAttrib'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|308|undefined reference to `glPushAttrib'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|310|undefined reference to `glMatrixMode'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|311|undefined reference to `glPushMatrix'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|312|undefined reference to `glMatrixMode'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|313|undefined reference to `glPushMatrix'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|314|undefined reference to `glMatrixMode'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|315|undefined reference to `glPushMatrix'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderTarget.cpp.obj)||In function `sf::RenderTarget::popGLStates()':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|327|undefined reference to `glMatrixMode'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|328|undefined reference to `glPopMatrix'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|329|undefined reference to `glMatrixMode'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|330|undefined reference to `glPopMatrix'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|331|undefined reference to `glMatrixMode'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|332|undefined reference to `glPopMatrix'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|334|undefined reference to `glPopClientAttrib'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|335|undefined reference to `glPopAttrib'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderTarget.cpp.obj)||In function `sf::RenderTarget::resetGLStates()':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|360|undefined reference to `glDisable'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|361|undefined reference to `glDisable'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|362|undefined reference to `glDisable'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|363|undefined reference to `glDisable'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|364|undefined reference to `glEnable'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|365|undefined reference to `glEnable'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|366|undefined reference to `glMatrixMode'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|367|undefined reference to `glEnableClientState'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|368|undefined reference to `glEnableClientState'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|369|undefined reference to `glEnableClientState'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderTarget.cpp.obj)||In function `sf::RenderTarget::applyCurrentView()':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|405|undefined reference to `glViewport'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|408|undefined reference to `glMatrixMode'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|409|undefined reference to `glLoadMatrixf'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|412|undefined reference to `glMatrixMode'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderTarget.cpp.obj)||In function `sf::RenderTarget::applyBlendMode(sf::BlendMode const&)':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|430|undefined reference to `glBlendFunc'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderTarget.cpp.obj)||In function `sf::RenderTarget::applyTransform(sf::Transform const&)':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderTarget.cpp|471|undefined reference to `glLoadMatrixf'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(RenderWindow.cpp.obj)||In function `sf::RenderWindow::capture() const':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\RenderWindow.cpp|92|undefined reference to `glReadPixels'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(Shader.cpp.obj)||In function `checkMaxTextureUnits':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Shader.cpp|62|undefined reference to `glGetIntegerv'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(Shader.cpp.obj)||In function `sf::Shader::compile(char const*, char const*)':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Shader.cpp|613|undefined reference to `glFlush'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(Texture.cpp.obj)||In function `checkMaximumTextureSize':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp|64|undefined reference to `glGetIntegerv'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(Texture.cpp.obj)||In function `sf::Texture::~Texture()':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp|110|undefined reference to `glDeleteTextures'|
..\..\Libraries\SFML-2.3.1\lib\libsfml-graphics-s-d.a(Texture.cpp.obj)||In function `sf::Texture::create(unsigned int, unsigned int)':|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp|151|undefined reference to `glGenTextures'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp|178|undefined reference to `glBindTexture'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp|179|undefined reference to `glTexImage2D'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp|180|undefined reference to `glTexParameteri'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp|181|undefined reference to `glTexParameteri'|
D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp|182|undefined reference to `glTexParameteri'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
//
All search directories are setup as told in the tutorials. I have also attached (snapshots) of my dependencies which are being linked. Thank you.
« Last Edit: September 27, 2015, 02:34:23 pm by Manu94 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
SFML 2.3.1 Linker Errors in CodeBlocks GCC 4.9.2 MinGW (SEH) - 64-bi
« Reply #1 on: September 27, 2015, 03:19:42 pm »
You're not linking OpenGL and some other system libraries. Check the tutorial again for the complete list. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Manu94

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: SFML 2.3.1 Linker Errors in CodeBlocks GCC 4.9.2 MinGW (SEH) - 64-bi
« Reply #2 on: September 27, 2015, 04:12:25 pm »
 ;D Thank you , just adding the opengl32 in the linker list did it. I have been breaking my head over what i missed, you saved me a ton of hours :)