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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Marcvs

Pages: [1]
1
Window / LNK2019 : unresolved external symbol
« on: September 01, 2011, 11:06:01 am »
Thanks for the answers :)

@Ricky
I linked these libraries:

sfml-window.lib (release mode)
sfml-window-d.lib (debug mode)

I added SFML_DYNAMIC in the preprocessor (release mode).

About sfml directories, I followed the first tutorial and everything is working properly.

@Laurent
I know that sf::Clock is in sfml-system, but it's not necessary to link because Window.hpp already does it.
I put .dll files (sfml-window.dll and sfml-system.dll and -d versions) in the directory of the project.

...

I'm stupid. I'm very stupid... :oops:
While I'm writing this post I try to redefine libraries in the linker... I used ';' to separate .lib files when I don't have to do it!

Sorry for the lost time :lol:
Now everything works properly!

2
Window / LNK2019 : unresolved external symbol
« on: September 01, 2011, 03:54:25 am »
Hi everyone!
I'm new in this forum and my english is awful (I'm italian)... Please, be patient :)

So... This is my first post and I need your help :(
I try to do the "handling time" tutorial, but the linker gives me an "unresolved external symbol" error (LNK2019). It say that the reference to the namespace Clock (sf::Clock) is unresolved but I'm sure I linked all necessary libraries (sfml-window.lib and sfml-window-d.lib).

This is what I wrote (main.cpp):
Code: [Select]
#include <SFML/Window.hpp>
#include <iostream>

int main() {

sf::Window App(sf::VideoMode(800,600,32),"SFML Window - handling time");

sf::Clock Clock;
float time = 0;

while(App.IsOpened()) {

sf::Event Event;
        while (App.GetEvent(Event)) {
if((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}

time = Clock.GetElapsedTime();
Clock.Reset();

std::cout << "Elapsed time: " << time << std::endl;

App.Display();
}

return EXIT_SUCCESS;

}


And this is what the linker says:

Code: [Select]
Errore 1 error LNK2019: riferimento al simbolo esterno "public: void __thiscall sf::Clock::Reset(void)" (?Reset@Clock@sf@@QAEXXZ) non risolto nella funzione _main main.obj 6_Window - Handling time
Errore 2 error LNK2019: riferimento al simbolo esterno "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ) non risolto nella funzione _main main.obj 6_Window - Handling time
Errore 3 error LNK2019: riferimento al simbolo esterno "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ) non risolto nella funzione _main main.obj 6_Window - Handling time
Errore 4 fatal error LNK1120: 3 esterni non risolti C:\Users\XXX\Documents\Visual Studio 2008\Projects\SFML-1.6\6_Window - Handling time\Debug\6_Window - Handling time.exe 1 6_Window - Handling time


I'm under Windows 7 (64 bit), I use Visual Studio 2008 Pro and the version of the SFML is the 1.6.

What did I wrong? (except my english... :lol:)

Pages: [1]