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

Author Topic: Setup/Compiler Error.  (Read 1420 times)

0 Members and 1 Guest are viewing this topic.

HappyHitman

  • Newbie
  • *
  • Posts: 2
    • AOL Instant Messenger - 24+Parker+Avenue
    • View Profile
Setup/Compiler Error.
« on: December 12, 2010, 05:31:38 pm »
Hello people, I was trying to set up SFML-1.6 with Codeblocks but I keep getting these errors when I compile.
Code: [Select]
reference to `sf::Clock::Clock()'|
obj\Debug\main.o(.text+0x13c):C:\Users\Rob\Desktop\CodeBlocks\Everything\main.cpp|7|undefined reference to `sf::Clock::GetElapsedTime() const'|
obj\Debug\main.o(.text+0x156):C:\Users\Rob\Desktop\CodeBlocks\Everything\main.cpp|9|undefined reference to `sf::Clock::GetElapsedTime() const'|
obj\Debug\main.o(.text+0x183):C:\Users\Rob\Desktop\CodeBlocks\Everything\main.cpp|10|undefined reference to `sf::Sleep(float)'|
||=== Build finished: 4 errors, 0 warnings ===|


Here is the code I am using:
Code: [Select]
#include <SFML/System.hpp>
#include <iostream>
using namespace std;
int main()
{
 sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}


I followed the installation tut from here:
http://www.sfml-dev.org/tutorials/1.6/start-cb.php

I think I followed everything correctly, each one looks correctly and I have set my compiler options up as the pictures state.

Does anybody know why I am getting this error? Any help would be appreciated.

Thanks in Advanced.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Setup/Compiler Error.
« Reply #1 on: December 12, 2010, 05:40:44 pm »
Did you link the libraries? The linker can't find the definitions of the specified functions.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

HappyHitman

  • Newbie
  • *
  • Posts: 2
    • AOL Instant Messenger - 24+Parker+Avenue
    • View Profile
Setup/Compiler Error.
« Reply #2 on: December 12, 2010, 05:57:18 pm »
I believe so in my linker I have these:
-lsfml-audio
-lsfml-graphics
-lsfml-window
-lsfml-system

Is that correct?