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

Author Topic: error LNK2001 ...  (Read 5777 times)

0 Members and 1 Guest are viewing this topic.

Metaby

  • Newbie
  • *
  • Posts: 23
    • View Profile
error LNK2001 ...
« on: May 04, 2008, 10:55:24 am »
Hello, I use the Microsoft Visual Studio 2008 Express Edition Compiler and Windows XP SP2 32 bit,
I have downloaded the SFML-SDK and copied the .lib datas into the lib folder
and the .h datas into the include folder.
then, I have created a new Project (Win32 Application) in my compiler and have set the linker option "input", I included the lib "sfml-system.lib"
then i have tried the first code of this tutorial
Code: [Select]
#include <SFML/System.hpp>
#include <iostream>

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


When I compile it, it works.
But when I will debugg it, I get 2 failures:

Fehler   1   error LNK2001: Nicht aufgelöstes externes Symbol "_WinMain@16".   MSVCRT.lib
Fehler   2   fatal error LNK1120: 1 nicht aufgelöste externe Verweise.   C:\Dokumente und Einstellungen\Arantir\Eigene Dateien\Projekte und Anderes\Programmieren\SFML\Release\SFML.exe

It seems like Linker-failures.. what should I do?

sorry for my bad english ^^
mfg max
I hacked 127.0.0.1 *g*

PM

  • Newbie
  • *
  • Posts: 18
    • View Profile
error LNK2001 ...
« Reply #1 on: May 04, 2008, 01:11:57 pm »
You have created a Windows Application project, therefor - linker is expecting WinMain function to be defined. It's an entry point.

From your code, it is clear, that what you wanted was a Console Application project, so that linker would know that the function "main" is the entry point function.

You can change this setting in project properties (right-click on the project in solution explorer, choose properties). Now, on the left side, choose "Configuration properties -> Linker -> System" and on the right side, set SubSystem to "Console (/SUBSYSTEM:CONSOLE)".

Metaby

  • Newbie
  • *
  • Posts: 23
    • View Profile
error LNK2001 ...
« Reply #2 on: May 04, 2008, 01:22:21 pm »
hm.. thank you, I have done this,
but now, I have a new problem -.-
the linker-failures don't come again, but vsc++ told me, that the application can't be startet, because of a false Applicationconfiguration.. VSC++ says I should check the manifest for failures, how can I check the manifest?

I hate microsoft.. everytime I fix one failure, i get the next..

dos anybody know what to do? =(

mfg max
I hacked 127.0.0.1 *g*

workmad3

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
error LNK2001 ...
« Reply #3 on: May 04, 2008, 08:22:50 pm »
If you are using the pre-built 1.2 files, then I'd suggest rebuilding SFML, using the new .lib and .dll files generated and relinking your app against that. It's a known issue with the 1.2 lib files :)

Metaby

  • Newbie
  • *
  • Posts: 23
    • View Profile
error LNK2001 ...
« Reply #4 on: May 04, 2008, 09:18:05 pm »
hm..? sry my english isn't very well.. I have the newest .lib's .dll's and .hpp's downloaded.. how can I rebuild this? sry I don't understand =/

EDIT: ähm.. ok, I've put the static libs from 2005 into the lib foulder from my vsc++2008EE .. it works T_T

why?? I'm happy about that, but why I must use the 2005 libraries in 2008 ??

mfg max
I hacked 127.0.0.1 *g*

Literacy_Hooligan

  • Newbie
  • *
  • Posts: 1
    • View Profile
error LNK2001 ...
« Reply #5 on: May 05, 2008, 11:10:02 pm »
Quote from: "Metaby"
hm..? sry my english isn't very well.. I have the newest .lib's .dll's and .hpp's downloaded.. how can I rebuild this? sry I don't understand =/

EDIT: ähm.. ok, I've put the static libs from 2005 into the lib foulder from my vsc++2008EE .. it works T_T

why?? I'm happy about that, but why I must use the 2005 libraries in 2008 ??

mfg max


Bugs and alike. I also had the problem, but my error was different: It was code -1072365566. And believe it or not, microsoft's dlls are responsible for all this. Hell, as long as SFML works for now... it works for me. VC2005 libraries aren't so bad if you use them with VC2008.

 

anything