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

Author Topic: Need help with Visual Studio Tutorial  (Read 1304 times)

0 Members and 2 Guests are viewing this topic.

VegetableNinja

  • Newbie
  • *
  • Posts: 2
    • View Profile
Need help with Visual Studio Tutorial
« on: October 15, 2015, 04:59:00 pm »
Hi,

New SFML user here. I've been following this tutorial here: http://www.sfml-dev.org/tutorials/2.3/start-vc.php

Once I tried running the example code, I got these errors on Debug:
Quote
error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)

However when I run it on Release, it works just fine. What could be the cause of this?

I have these libraries in both my Debug and Release:
Quote
sfml-graphics.lib
sfml-window.lib
sfml-system.lib

(Example code I'm referring to:)
(click to show/hide)

Thank you in advance!

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Need help with Visual Studio Tutorial
« Reply #1 on: October 15, 2015, 05:02:48 pm »
If you read the tutorial you linked without skimming over it you would read that in debug mode you must link to libs ending in -d. So in debug mode link to sfml-xxx-d.lib files. Debug and release libs are not interchangeable.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

VegetableNinja

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Need help with Visual Studio Tutorial
« Reply #2 on: October 15, 2015, 05:07:10 pm »
I had tried that prior to posting this (In fact its still like that now) and the error is the same.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Need help with Visual Studio Tutorial
« Reply #3 on: October 15, 2015, 05:13:17 pm »
And if you aren't linking to static libs make sure SFML_STATIC is not defined anywhere.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor