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

Author Topic: Errors in Codeblocks  (Read 3613 times)

0 Members and 1 Guest are viewing this topic.

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
Errors in Codeblocks
« on: November 14, 2010, 08:01:15 am »
Hi!
I just installed SFML 1.6 with Codeblocks 10.05 and I am having some problems.  I made the clock program work, so I thought I was done and it's working, but it seems otherwise. I downloaded the code on windows in the tutorial, and it gives 6 errors:


obj\Debug\main.o||In function `main':|
E:\info\stuff\test\main.cpp|17|undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
E:\info\stuff\test\main.cpp|17|undefined reference to `sf::Window::Window(sf::VideoMode, std::string const&, unsigned long, sf::WindowSettings const&)'|
E:\info\stuff\test\main.cpp|17|undefined reference to `sf::Window::~Window()'|
E:\info\stuff\test\main.cpp|23|undefined reference to `sf::Window::Display()'|
E:\info\stuff\test\main.cpp|26|undefined reference to `sf::Window::~Window()'|
E:\info\stuff\test\main.cpp|26|undefined reference to `sf::Window::~Window()'|
||=== Build finished: 6 errors, 0 warnings ===|


What am I doing wrong?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Errors in Codeblocks
« Reply #1 on: November 14, 2010, 09:33:09 am »
You didn't link to sfml-window in your project's build options. See tutorial.
SFML / OS X developer

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
Errors in Codeblocks
« Reply #2 on: November 14, 2010, 10:19:09 am »
I liked to sfml-window, but now it says sfml-window.dll is missing. I did copy sfml-window.dll to the Codeblocks directory, as I assume this is the "executable's directory" reffered to in the tutorial.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Errors in Codeblocks
« Reply #3 on: November 14, 2010, 10:27:44 am »
The tutorial refers to your executable, the one you compiled.
Laurent Gomila - SFML developer

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
Errors in Codeblocks
« Reply #4 on: November 14, 2010, 10:34:38 am »
It's working!!
Thanks. :)

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
Errors in Codeblocks
« Reply #5 on: November 14, 2010, 03:55:49 pm »
I've tried doing some tutorials, but I've got another error:

obj\Debug\main.o||In function `main':|
E:\info\stuff\Test\main.cpp|6|undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, std::string const&, unsigned long, sf::WindowSettings const&)'|
E:\info\stuff\Test\main.cpp|11|undefined reference to `sf::RenderWindow::~RenderWindow()'|
E:\info\stuff\Test\main.cpp|6|undefined reference to `sf::RenderWindow::~RenderWindow()'|
||=== Build finished: 3 errors, 0 warnings ===|


I know it's the same type of problem, but I just don't understand how I can solve this. I included <SFML/Graphics.hpp>  . Other stuff works fine, but I can't use RenderWindow. I did copy the dll's to the executable's  directory, I liked to -lsfml-window, but it still doesn't work.

I tried copying source codes from several tutorials, but none works, so I think the problem is I liked something wrong.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Errors in Codeblocks
« Reply #6 on: November 14, 2010, 04:01:04 pm »
You must link to sfml-graphics.

In case you haven't understood yet, if you include <SFML/Xxx.hpp> then you must link to sfml-xxx ;)
Laurent Gomila - SFML developer

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
Errors in Codeblocks
« Reply #7 on: November 14, 2010, 04:24:41 pm »
I also tried linking to sfml-graphics, as I tried everying that went through my head. :)
Error after linking -lsfml-graphics

obj\Debug\main.o||In function `main':|
E:\info\stuff\Test\main.cpp|6|undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
||=== Build finished: 1 errors, 0 warnings ===|

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Errors in Codeblocks
« Reply #8 on: November 14, 2010, 04:26:50 pm »
You still need sfml-window. The dependencies between modules are described in the "getting started" tutorials.
Laurent Gomila - SFML developer

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
Errors in Codeblocks
« Reply #9 on: November 14, 2010, 04:34:11 pm »
It works. Thanks again. :)

 

anything