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

Author Topic: Linker Error  (Read 3571 times)

0 Members and 1 Guest are viewing this topic.

adikid89

  • Newbie
  • *
  • Posts: 13
    • MSN Messenger - adikid89@yahoo.com
    • View Profile
Linker Error
« on: September 25, 2010, 04:54:27 pm »
I'm getting this error when trying to compile the code below:

error LNK2001: unresolved external symbol _WinMain@16
Code: [Select]

#include <iostream>
#include <SFML/System.hpp>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}


The project is on Release, and the additional dependencies are: sfml-system.lib

PeterWelzien

  • Newbie
  • *
  • Posts: 38
    • View Profile
Linker Error
« Reply #1 on: September 25, 2010, 06:12:52 pm »
There are three possible solutions to this problem:

1) Link with sfml-main.lib.
2) Build the project as a console application instead of a windows application.
3) Rename main() to WinMain().
/Peter Welzien