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

Author Topic: Simple Noob error with the Windows Tutorial  (Read 13670 times)

0 Members and 1 Guest are viewing this topic.

x-ecutioner

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple Noob error with the Windows Tutorial
« on: February 27, 2010, 07:23:28 pm »
Hey guys,

i keep getting a LNK 2019 error in visual c++ 2008 express:
Code: [Select]

1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Window::~Window(void)" (__imp_??1Window@sf@@UAE@XZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Display(void)" (__imp_?Display@Window@sf@@QAEXXZ) referenced in function _main
1>test.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::WindowSettings const &)" (__imp_??0Window@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>C:\Users\bakhtawar\Documents\Visual Studio 2008\Projects\SFMLtictactoe\Debug\SFMLtictactoe.exe : fatal error LNK1120: 4 unresolved externals
1>Build log was saved at "file://c:\Users\*********\Documents\Visual Studio 2008\Projects\SFMLtictactoe\SFMLtictactoe\Debug\BuildLog.htm"
1>SFMLtictactoe - 5 error(s), 0 warning(s)


based on the code i copied from the tutorial:

Code: [Select]

#include <SFML/Window.hpp>

int main(){
// Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");


bool Running = true;
while (Running)
{
App.Display();
}

return EXIT_SUCCESS;

}


the previous tutorial involving threading and even the very first script with timing worked fine for me so i believe i have appropriately linked to the appropriate SFML:

include files:


and library files:


as a matter of interest, I am linking to the microsoft SDK based on advice given on this thread from about a year or two ago:
http://www.sfml-dev.org/forum/viewtopic.php?t=244

I also researched heavily and came accross this link, but found that it did not help me:
http://www.sfml-dev.org/forum/viewtopic.php?t=1553&highlight=lnk2019

I also have the following aspects established under my project properties:




finally, i am running windows 7, and the ATI Radeon HD 5750 graphics card.

any help would be greatly appreciated.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Simple Noob error with the Windows Tutorial
« Reply #1 on: February 27, 2010, 08:03:48 pm »
YOu  need to link to sfml-window, too.

Edit: I saw your active configuration is "Debug". Therefore you need to link to "sfml-system-d" and "sfml-window-d".

x-ecutioner

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #2 on: February 27, 2010, 09:09:23 pm »
thank you for your response


however,

i am getting the following error:
Code: [Select]

>LINK : fatal error LNK1104: cannot open file 'sfml-system-d;sfml-window-d.obj'


under additional dependencies
i just put
sfml-system-d;sfml-window-d

any ideas?

thank you

Edit: do i have to change my preprocessor from SFML_DYNAMIC to something else since im running the debug mode?  Or do i have to paste the sfml-system-d and sfml-window-d files into the debug directory of my Visual basic project folder?

JollyRoger

  • Newbie
  • *
  • Posts: 17
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #3 on: February 27, 2010, 10:17:26 pm »
It appears you forgot the ".lib" at the end.  You should be linking against "sfml-system-d.lib" and "sfml-winodw-d.lib".

x-ecutioner

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #4 on: February 27, 2010, 11:48:06 pm »
thank you both for your help so far

i feel we are getting closer to the exact root of the problem

after adjusting the linker input to exactly
Code: [Select]

Additional dependencies: sfml-system-d.lib;sfml-window-d.lib

i am now getting the following error:

Code: [Select]

1>LINK : fatal error LNK1104: cannot open file 'sfml-system-d.lib;sfml-window-d.lib'


any help would be greatly appreciated
thank you

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #5 on: February 28, 2010, 08:06:22 am »
It thinks the two files are the same file. Have you tried separating with spaces(I don't use MSVC, but it's worth a shot)
I use the latest build of SFML2

Resnis

  • Newbie
  • *
  • Posts: 7
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #6 on: March 03, 2010, 11:44:25 pm »
I have the same problem, but i have done everything to prevent it. My vc++ just doesn't seem to be able to find sfml.system-d.lib and sfml.graphics-d.lib :(
Code: [Select]
LINK : fatal error LNK1104: cannot open file 'sfml.system-d.lib'
Checked it multiple times. Maybe it has something to do with compilers settings? Altough everything seems to be set and linked right.
EDIT: i was using the graphics tut, but the idea is the same.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Simple Noob error with the Windows Tutorial
« Reply #7 on: March 04, 2010, 07:34:13 am »
Can you describe what you did?
Laurent Gomila - SFML developer

CBenni::O

  • Newbie
  • *
  • Posts: 48
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #8 on: March 04, 2010, 06:30:01 pm »
Have you included the 'lib'  folders of SFML, too?

bye, CBenni::O
42!
Metal will never die!

JollyRoger

  • Newbie
  • *
  • Posts: 17
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #9 on: March 04, 2010, 11:08:13 pm »
Unless you renamed the files, you should be linking against "sfml-sytem-d.lib" and "sfml-graphics-d.lib".  There should be a hyphen ("-") in between instead.

Resnis

  • Newbie
  • *
  • Posts: 7
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #10 on: March 05, 2010, 12:32:36 pm »
Ah, yes, how did i miss that? Thank you!
Then i had the same problem, that OP did - unresolved externals. But linking to sfml-window-d.lib as well, fixed it. The question is - why do i have to use both window and graphics libraries? In the tutorial it is said, that graphics library has the functions needed.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Simple Noob error with the Windows Tutorial
« Reply #11 on: March 05, 2010, 01:04:33 pm »
Quote
In the tutorial it is said, that graphics library has the functions needed

The tutorial says that <SFML/Graphics.hpp> includes <SFML/Window.hpp>, nothing more.
Laurent Gomila - SFML developer

Resnis

  • Newbie
  • *
  • Posts: 7
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #12 on: March 05, 2010, 01:32:21 pm »
Sorry, then it must be my lack of english knowledge.
Thanks for all the help, this library really is simple to learn, getting hang of it right now!

Resnis

  • Newbie
  • *
  • Posts: 7
    • View Profile
Simple Noob error with the Windows Tutorial
« Reply #13 on: March 06, 2010, 04:55:56 pm »
Still having problems with setting up :/
Everything went fine, till text tutorial. VC++ started giving me these errors, when exiting the app:

Wasn't able to find a way to get rid of it, so now I'm asking again for help.

EDIT: i had CodeBlocks, so i tried to set up on them aswell, and it has the same problem. What am i doing wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Simple Noob error with the Windows Tutorial
« Reply #14 on: March 06, 2010, 07:22:27 pm »
This is a known bug with sf::String. It doesn't happen if you link to the SFML static libraries.
Laurent Gomila - SFML developer

 

anything