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

Author Topic: VS2011 - Set it up per solution?  (Read 4732 times)

0 Members and 1 Guest are viewing this topic.

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
VS2011 - Set it up per solution?
« on: April 02, 2012, 08:06:54 am »
Hi there...

In Vs2011 the options in the tutorial for setting it up is "depreciated" and it tells me to use the properties page on the individual projects. This is a real hassle as I need to "setup" sfml every time I start a new project inside the solution.

Is there a way in VS2011 (using a directory of my choice) to have SFML loaded for the entire solution? So every time I start a new project in teh solution it is already set up?

I am sorry if this is a stupid question but I am new to programming and only learning.

Thanks in advance
--aNewHobby
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VS2011 - Set it up per solution?
« Reply #1 on: April 02, 2012, 08:35:29 am »
You should find plenty of answers by searching this on Google, many people have complained about the lack of global properties.

But, in my opinion, this is not a good idea to have some libraries globally set up -- although the tutorial says to do so (I will change this in the new tutorials). Global properties can be bad because they are implicitly applied to any new project, and it can make it hard to use different versions of the same library in different projects.

Setting up a library is just a matter of defining three options in your project, and you're not creating a new project everyday, are you? So I wouldn't call it a "hassle".
Laurent Gomila - SFML developer

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: VS2011 - Set it up per solution?
« Reply #2 on: April 02, 2012, 10:04:45 am »
Well that is fine, I was just curious. I am only learning so some of these methods are new to me. I thought maybe there was a new way in vs2011 that I didn't know of.

Just as I am learning I like have been making a new project ... like for example I have a solution called "Playing with SFML" and been making new project for every single tutorial as I was playing with the different things.. doing small tests and stuff. So in one session I made 10 projects....

Maybe there is a better way to do it.. but every time i wanted to compile something i made a new project even if I just wanted to test something simple.

Anyway, thanks for the reply
--aNewHobby
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: VS2011 - Set it up per solution?
« Reply #3 on: April 02, 2012, 12:46:53 pm »
Problem....

I have it compiling.. but in the tutorial it says...

"Important: for the Debug configuration, you have to link with the debug versions of the libraries, which have the "-d" suffix (sfml-system-d.lib in this case). If you don't, you may get undefined behaviours and crashes. "

But if I change the input thing for "debug" form sfml-system.lib -> sfml-system-d.lib it errors on compile.
http://screencast.com/t/zESVt7Q4fAy

If i remove the dll I get this error...
http://screencast.com/t/wStCvMlKk5rf

If I use the lib with out -d and its corresponding dll it works fine... (I am using the "clock" code in teh "setting up VS" part of tutorial.)

<<---- I still can not get anything to work :(

I am trying to add music and sound effects... I am running the exact code from the music tutorial downloadable cpp, but replaced it is all going wired....

I added to teh if statment a pause.. so you can read b4 it exits the app on the error...

Code: [Select]
int main()
{
// Load the music from an OggVorbis file
sf::Music Music;
if (!Music.OpenFromFile("music.ogg")){
std::cout << "Press enter to exit..." << std::endl;
std::cin.ignore(10000, '\n');
return EXIT_FAILURE;}

return EXIT_SUCCESS;
}

This is that the error looks like in the console...
http://screencast.com/t/6zreq0DV

I have tried it using a "real" file.. ogg and wav.. same error in the console... I am compiling as release as the -d thing isn't working... and I have also copied the libsndfile-1.dll and openal32.dll into the dir and tried adding sfml-audio.dll to the linker along with system one..

I know I am a beginner and stuff.. but I can not seam to even get the basics functioning... I would really appreciate some help if you get the time..

Thanks in advance
« Last Edit: April 02, 2012, 01:53:26 pm by aNewHobby »
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VS2011 - Set it up per solution?
« Reply #4 on: April 02, 2012, 01:22:53 pm »
Have you recompiled SFML first?
Laurent Gomila - SFML developer

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: VS2011 - Set it up per solution?
« Reply #5 on: April 02, 2012, 01:55:12 pm »
Have you recompiled SFML first?
Um, I just grabbed "Windows - Visual C++ 2008 (23.5 MB)" (SFML full SDK (headers / libraries / documentation / sources / samples / external libraries)) from the download page and extracted into a directory, I thought you only needed to compile if you were using svn or something?
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: VS2011 - Set it up per solution?
« Reply #6 on: April 02, 2012, 02:00:45 pm »
Um ok, I loaded up the svn and hit build... but still same problems...

I'm pretty confused now.. there seams to be a new dir of libs in a dir called 2008? do i over right them into the lib dir?

This is my 1st time using a now standard library.. thanks for your patience.
« Last Edit: April 02, 2012, 02:02:22 pm by aNewHobby »
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VS2011 - Set it up per solution?
« Reply #7 on: April 02, 2012, 04:10:24 pm »
Quote
I thought you only needed to compile if you were using svn or something?
Libraries built with VC++ 2008 are (sadly) not compatible with VC++ 2010 or 2011.

Quote
Um ok, I loaded up the svn and hit build... but still same problems...
Compile the sources that you got in the SDK that you downloaded, don't get a SVN version.
There are many threads on this forum about recompiling SFML with VC++ 2010 (should be the same for 2011). You can even find precompiled binaries or video tutorials.
Laurent Gomila - SFML developer

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: VS2011 - Set it up per solution?
« Reply #8 on: April 02, 2012, 09:26:51 pm »
Thanks.. i was getting confused as the build places the files in a directory called 2008 inside the root of /lib/

So I just pointed to that instead of the /lib/ file and it is now working.. big thanks to MrX in irc for those tips....

Video Tutorials you say? Cool... links?
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VS2011 - Set it up per solution?
« Reply #9 on: April 02, 2012, 10:29:43 pm »
Quote
Video Tutorials you say? Cool... links?
It's hidden somewhere in this forum, I don't know where (it's an external tutorial, not one that I made).
Laurent Gomila - SFML developer

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: VS2011 - Set it up per solution?
« Reply #10 on: April 03, 2012, 12:43:22 am »
I have my solution on a USB drive so I can work on it at home and take it into UNI.

Is there a way to add paths to the vs++ paths that are not absolute? So I could place the SFML library in a dir inside my solution folder on the usb, and then load the solution and it will find the paths to the library relative to the solution folder... ?
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VS2011 - Set it up per solution?
« Reply #11 on: April 03, 2012, 07:53:24 am »
All project specific settings can be relative to the project dir, the solution dir, ... There are many macros available to represent these paths ($(ProjectDir), $(SolutionDir), ... -- if they haven't changed in VS 2011).
Laurent Gomila - SFML developer

 

anything