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

Author Topic: VS2012 not recognizing "Texture" within sf namespace  (Read 2105 times)

0 Members and 1 Guest are viewing this topic.

Mad Man

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
VS2012 not recognizing "Texture" within sf namespace
« on: September 05, 2013, 03:00:53 am »
Hey all,

I've got a weird issue. For some reason, some of the files in my project don't detect "Texture" as a member of the sf namespace, while others do. They all include stdafx.h, which in turn includes SFML\Graphics.hpp.

But even if I just type "sf" and let the drop-down come up, Texture isn't in there for some of the files.

I've tried cleaning and rebuilding the entire solution, but I don't know what else to do.

EDIT - I'm using SFML 2.1, which I didn't build myself, and has been working fine. I'm guessing there's some weird issue with my VS 2012, but I was wondering if anyone else experienced this and had any solutions.
« Last Edit: September 05, 2013, 03:02:27 am by Mad Man »

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: VS2012 not recognizing "Texture" within sf namespace
« Reply #1 on: September 05, 2013, 03:42:02 am »
I've done console apps in VS before, and I'm pretty sure stdafx.h has nothing to do with SFML (it's certainly not part of SFML itself), so are you sure that it's really including SFML/Graphics.hpp?  And have you tried including SFML/Graphics.hpp yourself?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VS2012 not recognizing "Texture" within sf namespace
« Reply #2 on: September 05, 2013, 03:48:15 am »
I've done console apps in VS before, and I'm pretty sure stdafx.h has nothing to do with SFML (it's certainly not part of SFML itself), so are you sure that it's really including SFML/Graphics.hpp?  And have you tried including SFML/Graphics.hpp yourself?

"stdafx.h" is a microsoft specific thing that is really just a "pre-compiled header". Just google if you want more information on it. Most people don't use it.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Mad Man

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: VS2012 not recognizing "Texture" within sf namespace
« Reply #3 on: September 05, 2013, 03:54:28 am »
Even when I don't use stdafx and just directly include sfml\graphics.hpp, VS won't recognize texture as part of the namespace for some files. Even stranger, even in the files that don't recognize Texture, they still recognize other stuff like sf::Sprite and sf::Shape.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VS2012 not recognizing "Texture" within sf namespace
« Reply #4 on: September 05, 2013, 08:03:23 am »
There's nothing to do against Intellisense bugs. A lot of people post on this forum about it, but auto-completion in IDEs don't work reliably, just live with that.
Laurent Gomila - SFML developer

Mad Man

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: VS2012 not recognizing "Texture" within sf namespace
« Reply #5 on: September 05, 2013, 09:16:01 pm »
Thanks all. As expected, it was a problem with VS 2012. I just went into the configuration properties and cleared everything in C++>General>Additional Include Directories, saved, restarted VS 2012 and re-included it all and it worked.

Hope this helps anyone else who bumps into this bug.

 

anything