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

Author Topic: [C++]Codeblocks Tutorial Compile Errors  (Read 4203 times)

0 Members and 1 Guest are viewing this topic.

lfnunley

  • Newbie
  • *
  • Posts: 12
    • View Profile
[C++]Codeblocks Tutorial Compile Errors
« on: March 25, 2013, 07:07:12 am »
I just finished setting up SMFL with CodeBlocks, following this tutorial: http://www.sfml-dev.org/tutorials/2.0/start-cb.php, and linking the static libraries. I am getting the following errors when attempting to compile:
Code: [Select]
error: 'CircleShape' is not a member of 'sf'
error: expected ';' before 'shape'
error: 'shape' was not declared in this scope
error: 'class sf::RenderWindow' has no member named 'isOpen'

Along with many other errors of the same nature. It seems that there is a problem accessing the 'sf' class. I assume this is a newbie error, so sorry if I'm not doing something correctly.

I am using the C++ version 1.6 SMFL full SDK for Windows. Thanks in advance for your help!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #1 on: March 25, 2013, 07:44:45 am »
Quote
I am using the C++ version 1.6 SMFL
So why are you following the 2.0 tutorials? ::)
Laurent Gomila - SFML developer

lfnunley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #2 on: March 25, 2013, 04:40:57 pm »
Wow, my bad. Thank you for pointing out that human error! :P

lfnunley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #3 on: March 25, 2013, 09:56:17 pm »
Okay, I have followed the tutorial for 1.6, and I'm still getting errors of the same nature:
undefined reference to `sf::Clock::Clock()'
undefined reference to `sf::Clock::GetElapsedTime() const'
and so on. I'm sure this is once again a stupid error. I opted to set it up using the second option, editing the global compiler settings. Any ideas?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #4 on: March 25, 2013, 10:05:37 pm »
Do you link to sfml-system? If you linked to static libraries (-s), make sure that SFML_STATIC is defined.
Laurent Gomila - SFML developer

lfnunley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #5 on: March 25, 2013, 10:09:14 pm »
I am not linking to the static libraries, and -lsfml-system is linked: https://dl.dropbox.com/u/45353822/Pics/SMFL_config.png

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #6 on: March 25, 2013, 10:40:48 pm »
Does it look like the screenshot of the tutorial? ::)

And are you sure that SFML_STATIC is not defined in your preprocessor options? Can you upload your project file?
Laurent Gomila - SFML developer

lfnunley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #7 on: March 25, 2013, 10:44:51 pm »
It does indeed. And SMFL_STATIC isn't linked. Here is my project folder: http://dl.dropbox.com/u/45353822/SMFL_Example.zip

Also, the SMFL folder is in Program Files(x86)/codeblocks/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #8 on: March 25, 2013, 11:22:02 pm »
Your screenshot doesn't match at all what's inside your project... If you don't show us what you really have, it will be hard for us to help you :-\

Anyway, you're lucky because the error was really obvious to spot: you wrote "smfl" instead of "sfml" in libraries names.

Please be careful, all the errors in this thread were really stupid. They could be avoided very easily.
Laurent Gomila - SFML developer

lfnunley

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [C++]Codeblocks Tutorial Compile Errors
« Reply #9 on: March 25, 2013, 11:38:05 pm »
That was it? Okay then, sorry. I think I sent it to you before I saved it, which was idiotic. Thanks for your help!

 

anything