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

Author Topic: A simple complicated error [solved]  (Read 2862 times)

0 Members and 1 Guest are viewing this topic.

L_ermite

  • Newbie
  • *
  • Posts: 12
    • View Profile
A simple complicated error [solved]
« on: December 04, 2013, 09:26:45 pm »
Hello everybody and sorry if my english is bad, but I am French.
Today, my wonderful error seems don't come of a bad installation of the SFML, I explain:

I was do the migration of SFML1.6 to SFML2.0. Is unfortunately, I am in Linux Ubuntu and the last package installable is SFML1.6...
Therefore, I decide to install it no automatically. After have does all operations, I configure code block and try to run the simple example program. This is the errors appear to this:

-------------- Build: Debug in blablasfml ---------------

Compiling: main.cpp
main.cpp: In function ‘int main():
main.cpp:10:16: erreur:class sf::Image’ has no member named ‘LoadFromFile’
main.cpp:12:28: erreur: no matching function for call to ‘sf::Sprite::Sprite(sf::Image&)
main.cpp:12:28: note: candidates are:
/usr/include/SFML/Graphics/Sprite.hpp:78:5: note: sf::Sprite::Sprite(const sf::Texture&, const IntRect&)
/usr/include/SFML/Graphics/Sprite.hpp:78:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/SFML/Graphics/Sprite.hpp:67:14: note: sf::Sprite::Sprite(const sf::Texture&)
/usr/include/SFML/Graphics/Sprite.hpp:67:14: note:   no known conversion for argument 1 from ‘sf::Image’ to ‘const sf::Texture&
/usr/include/SFML/Graphics/Sprite.hpp:57:5: note: sf::Sprite::Sprite()
/usr/include/SFML/Graphics/Sprite.hpp:57:5: note:   candidate expects 0 arguments, 1 provided
/usr/include/SFML/Graphics/Sprite.hpp:47:25: note: sf::Sprite::Sprite(const sf::Sprite&)
/usr/include/SFML/Graphics/Sprite.hpp:47:25: note:   no known conversion for argument 1 from ‘sf::Image’ to ‘const sf::Sprite&
main.cpp:15:16: erreur:class sf::RenderWindow’ has no member named ‘IsOpened’
main.cpp:19:20: erreur:class sf::RenderWindow’ has no member named ‘GetEvent’
main.cpp:22:23: erreur:class sf::Event’ has no member named ‘Type’
main.cpp:23:21: erreur:class sf::RenderWindow’ has no member named ‘Close’
main.cpp:27:13: erreur:class sf::RenderWindow’ has no member named ‘Clear’
main.cpp:30:13: erreur:class sf::RenderWindow’ has no member named ‘Draw’
main.cpp:33:13: erreur:class sf::RenderWindow’ has no member named ‘Display’
Process terminated with status 1 (0 minutes, 2 seconds)
18 errors, 0 warnings

Sorry but befor 2 hours of search, I don't understand the source of this error. Please
enlighten me on the subject. Thank!
« Last Edit: December 07, 2013, 05:17:51 pm by L_ermite »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: A simple complicated error
« Reply #1 on: December 04, 2013, 09:38:25 pm »
You compile a code that uses SFML 1.6. SFML 2.x has lowercase function names.
For a list of changes, check out this thread.

By the way, there is a French forum...
« Last Edit: December 04, 2013, 09:47:42 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: A simple complicated error
« Reply #2 on: December 04, 2013, 09:38:45 pm »
There's a French forum.

Some names changed slightly to similar ones:
IsOpened => isOpen

All names now start with lower case:
Clear() => clear()
Draw() => draw()
Display() => display()
etc.

sf::Image is no longer used for drawing, just for loading, saving and manipulation, what sf::Image did in 1.6 is now done by sf::Texture.
Back to C++ gamedev with SFML in May 2023

L_ermite

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: A simple complicated error
« Reply #3 on: December 07, 2013, 10:11:49 am »
Sorry, my first message say to a recent problem. Thank you for answer me! But the really problem, once I have removed all the 1.6 code, it's that:
/usr/bin/ld: warning: libGLEW.so.1.7, needed by /usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewUniform1fARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shader_objects'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewGetObjectParameterivARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_vertex_shader'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewFramebufferTexture2DEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewUniformMatrix4fvARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewGenFramebuffersEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewUniform3fARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewRenderbufferStorageEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_fragment_shader'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewActiveTextureARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewShaderSourceARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `glewInit'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewBindFramebufferEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewFramebufferRenderbufferEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewLinkProgramARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewUseProgramObjectARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewBlendFuncSeparateEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewGenRenderbuffersEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewUniform2fARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewUniform4fARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewCreateProgramObjectARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `glewGetErrorString'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewCompileShaderARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewDeleteRenderbuffersEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewDeleteObjectARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewGetUniformLocationARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewGetInfoLogARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_blend_func_separate'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewDeleteFramebuffersEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewCheckFramebufferStatusEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewUniform1iARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_texture_non_power_of_two'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shading_language_100'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewCreateShaderObjectARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewBindRenderbufferEXT'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_framebuffer_object'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewAttachObjectARB'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/libsfml-graphics.so: undefined reference to `__glewGetHandleARB'

It give the impression of I have not installed GLEW, but I'm sure to have it (libglew1.6-dev). Do you have a solution?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: A simple complicated error
« Reply #4 on: December 07, 2013, 10:13:55 am »
Install GLEW and all the other dependencies as stated in the tutorial and rebuild SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

L_ermite

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: A simple complicated error
« Reply #5 on: December 07, 2013, 02:32:27 pm »
Ok, I have follow all the instruction, installed all dependencies, compiled SFML and the result seems better. Unfortunately, my program compile but say it when I launch them:
sfmltest: error while loading shared libraries: libGLEW.so.1.7: cannot open shared object file: No such file or directory
I had installed libglew1.5, therefore I will try install libglew1.7.

L_ermite

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: A simple complicated error
« Reply #6 on: December 07, 2013, 05:15:55 pm »
Yes! I have succeeded! I have simply installed SFML1.6 and glew-utils and the problem was mysteriously fly up. Thank you for your advices! Goodbye!  ;D

 

anything