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

Author Topic: Linker Errors  (Read 2439 times)

0 Members and 1 Guest are viewing this topic.

Elffus

  • Newbie
  • *
  • Posts: 13
    • View Profile
Linker Errors
« on: April 03, 2011, 05:03:26 pm »
Hi,

So after searching every thread on google and coming to no solution I decided to question here. Recently I downloaded SFML via git and compiled it,  this seemed to work flawlessly with no errors (I compiled in Release and Debug, VS2010).

I then proceeded to make a new project and copy in the .dll files from the debug library to my project folder (sfml-audio-d-2.dll, sfml-graphics-d-2.dll, sfml-network-d-2.dll, sfml-system-d-2.dll, sfml-window-d-2.dll).

After doing this I went into the property pages window and, under VC++ Directories, set my include directory to the SFML-2.0\include folder and the library directories to the SFML-2.0\build\lib folder. I then set SFML_DYNAMIC as the preprocessor definition, and changed my additional dependencies to:
sfml-system-d.lib
sfml-window-d.lib
sfml-graphics-d.lib
sfml-main-d.lib

After doing this I used code similar to that of the clock tutorial and created a clock that ran for 5 seconds. It worked perfectly with no errors. I then proceeded to use the following code:

Code: [Select]
#include <SFML/Window.hpp>

int main()
{
sf::Window App(sf::VideoMode(800,600,32), "Window");
while ( true )
{
App.Display();
}
return EXIT_SUCCESS;
}


Which returned the following:

Quote
1>------ Build started: Project: DENG, Configuration: Debug Win32 ------
1>Build started 03/04/2011 16:02:08.
1>InitializeBuildStatus:
1>  Touching "Debug\DENG.unsuccessfulbuild".
1>ClCompile:
1>  main.cpp
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Window::Window(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::ContextSettings const &)" (__imp_??0Window@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUContextSettings@1@@Z) referenced in function _main
1>D:\C++\DENG\Debug\DENG.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.44
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Does anyone have any suggestions as to what I've done/am doing wrong? It's probably something really obvious that I missed. Thanks.

Elffus

  • Newbie
  • *
  • Posts: 13
    • View Profile
Linker Errors
« Reply #1 on: April 03, 2011, 10:43:09 pm »
Turns out moving all the files from the /build/lib/Release and /build/lib/Debug directories into ../lib/ caused it to work perfectly.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Linker Errors
« Reply #2 on: April 03, 2011, 11:32:15 pm »
Probably the window library that was wrong or something.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

 

anything