SFML community forums

Help => General => Topic started by: ekeimaja on January 22, 2012, 08:53:54 pm

Title: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on January 22, 2012, 08:53:54 pm
I searched already, if there would be any topic about this subject...

All which i found, there was said "View - Property Manager". I have not that. Only "Properties Window" and "Property Pages".

I would be very gladful about your help, thank you very much already! :)
Title: SFML installing on Visual Studio 2010 Professional
Post by: Serapth on January 22, 2012, 11:18:18 pm
I'm a bit confused exactly what you are looking for, but if you are looking for detailed installation instructions for Visual Studio 2010, start right here (http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition-Part-1.aspx).  It should get you going.


If I misunderstood your request, please clarify.
Title: SFML installing on Visual Studio 2010 Professional
Post by: RedIrony on January 23, 2012, 02:28:54 am
Here is a youtube video (http://www.youtube.com/watch?v=PtSDrLpV74M&lc=vN6a9_S3nMRbdnAZCbG6HOKNt3j3yg3J7xCdRXZeDDE&context=C32d6917ADOEgsToPDskJ6DnT9LDtXlFctwZ7ePtn8) that I have found to be immensely helpful for setting up SFML 2.0 in VS2010. It should walk you through the entire process.
Title: SFML installing on Visual Studio 2010 Professional
Post by: eXpl0it3r on January 23, 2012, 11:20:33 am
Ehrm they don't differ very much.
The settings were you have to change something are the same in Express and Pro.
If you see something that doesn't match, then let us know and we could provid you with more information.
Title: SFML installing on Visual Studio 2010 Professional
Post by: TheEnigmist on January 23, 2012, 01:02:10 pm
Take a look of my thread:
http://www.sfml-dev.org/forum/viewtopic.php?p=44658#44658
Is just a bit under this :D
I use VS2010 Ultimate.
If you need help PM me ;)
Title: SFML installing on Visual Studio 2010 Professional
Post by: Serapth on January 23, 2012, 04:31:04 pm
Quote from: "ekeimaja"
Serapth, i mean how to install SFML 1.6 or 2.0 to Visual Studio 2010 Professional. All instructions that i have found were made with Express, where all menus were fully different. But i will test those instructions today...



Ah, Ic.  Those instructions were actually for Express, but as was said, they are pretty similar.  I have both installed right now, so if you get hung up on a specific thing missing, let me know.
Title: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on January 23, 2012, 07:13:36 pm
Quote from: "TheEnigmist"
Take a look of my thread:
http://www.sfml-dev.org/forum/viewtopic.php?p=44658#44658
Yesterday evening i tried to follow your instructions, but pictures did not match in my editor. For example I have not "Property Manager" in my View menu. Only Properties Window and Property Pages.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Keshi on May 17, 2012, 08:55:04 am
To View property manager in VCExpress, you can choose Tools -> Setting -> Expert settings. After that, you will see View -> Property Manager option.

http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/e7b6559e-b0c2-453a-bae6-4234a408fe4e
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 08, 2012, 10:37:16 am
To View property manager in VCExpress, you can choose Tools -> Setting -> Expert settings. After that, you will see View -> Property Manager option.

http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/e7b6559e-b0c2-453a-bae6-4234a408fe4e
I still have NOT Express...I have Visual Studio 2010 Professional
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: eXpl0it3r on October 08, 2012, 11:13:49 am
All which i found, there was said "View - Property Manager". I have not that. Only "Properties Window" and "Property Pages".
I'm not sure what you were following that stated you have to search in the view menu...
The official tutorial (http://www.sfml-dev.org/tutorials/2.0/start-vc.php) only says "In the project's properties" which obviously implies Project->Project Properties. As you can see in the image blow:
(http://wiki.oxygenelanguage.com/en-w/images/b/ba/ProjectOptionsAero.png)

To get the project menu entry to show, you have to open a project and you need to select the project in the Property Manager.

Finding yourself around menu entries etc is very basic stuff on how to operate with your computer and should be easy for a developer... :-\
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 09, 2012, 09:32:59 am
Now I reinstalled SFML-2.0 to C:\SFML and linked to VS as in tutorial was made. But now...gives this error. Tried both with release and debug.

error LNK1104: cannot open file 'sfml-graphics-d.lib sfml-window-d.lib sfml-system-d.lib kernel32.lib'

Could someone create very very easy instructions and ready Solution. That would help very much. Before I have used Allegro library, and that worked perfectly just following instructions.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 09:40:39 am
Quote
cannot open file 'sfml-graphics-d.lib sfml-window-d.lib sfml-system-d.lib kernel32.lib'
The linker thinks it's a single file, you must have formatted it badly in the "Additional dependencies" text box.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 09, 2012, 09:43:53 am
I wrote it same as in tutorial, only space, not commas or dots.

http://sfml-dev.org/tutorials/2.0/images/start-vc-link-libs.png (http://sfml-dev.org/tutorials/2.0/images/start-vc-link-libs.png)
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: eXpl0it3r on October 09, 2012, 09:55:04 am
Well you need to seperate them with a semicolon.
@Laurent: why are there only spaces? :o
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 10:34:56 am
Quote
@Laurent: why are there only spaces?
Because that how it works for me. I'm using VS 2008 but I don't think they changed that in VS 2010.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: eXpl0it3r on October 09, 2012, 10:57:22 am
Hmmm I'm not sure, but I've never used space, but always used semicolons, then again I've only worked with VS10 & VS12...
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 09, 2012, 11:23:25 am
Now I replaced spaces with semicolon, and that error disappeared (at last). But now there came new error...

error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?

If I add more includes,
#include
  comes red underlined.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: eXpl0it3r on October 09, 2012, 11:30:13 am
You should always start off with an empty project (not console nor window).
There's an optino somewhere in the project settings to deactivae precompiled headers.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 11:37:20 am
Precompiled header options are in "C/C++ > Precompiled headers". Don't use them if you don't know how they work ;)
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 01:06:15 pm
If you follow the tutorial step by step you get a working project. Trust me. And in case I'm wrong, then it will help others a lot more if you help me understand what's missing or incorrect in the tutorial, rather than throwing them an empty SFML project.

Do you link to the dynamic or static version of SFML? Are your defines set accordingly?
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: eXpl0it3r on October 09, 2012, 01:12:54 pm
I say this again... Please someone create for me empty, ready for use Solution file with ready SFML-settings. It will ease my and others work very much.
If you don't learn how to do this sort of thing, then you'll have a hard time programming in C++.

The error means that you're either mixing debug and release versions or that you mix static and dynamic library versions. Both 'sides' have to align with each other.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 09, 2012, 01:30:13 pm
Now I tried 2 times with SFML 2.0 tutorial. Did not work. Of course I can try 1.6 tutorial again. Or can someone record video when making SFML project from scratch? That would help also to see which parts I have maybe failed.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 01:35:32 pm
Quote
Did not worked
You're not helping us to solve your problem.

Please:
- post the error messages
- answer our questions

Or upload your .vcproj file, it will probably be faster than guessing what you might have done wrong, and asking you to tell us what parameters you used etc. ;)
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 09, 2012, 01:42:36 pm
I will try from beginning with 2.0 and by recording it now. Then we can see is tutorial wrong or do I just fail something.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 01:50:12 pm
No offense, but if you ignore what we are saying or asking, chances are we won't reply anymore.

I'm at work so I can't watch a video. But I can look at a .vcproj file.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 09, 2012, 03:12:50 pm
Now is made again, followed by 2.0 tutorial. Here is the full project zipped.

http://www.speedyshare.com/YtRuG/download/sfml.zip
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 03:38:05 pm
You define SFML_STATIC, but you link to the dynamic libraries (the static ones have the "-s" suffix"). This is clearly explained in the tutorial, isn't it?

Quote from: The tutorial
Static SFML libraries have the "-s" suffix: "sfml-xxx-s-d.lib" for Debug, and "sfml-xxx-s.lib" for Release.
In this case, you'll also need to define the SFML_STATIC macro in the preprocessor options of your project.

And by the way, this is what I asked you 7 posts ago ::)
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 03:57:01 pm
Quote from: The tutorial
don't forget to copy the SFML DLLs (they are in <sfml-install-path/bin>) to the directory where your compiled executable is

I told you, everything is explained. Just read carefully.

Quote
Well, took SFML_STATIC off and -d from linker input things
-d is for debug libraries. You must keep it in your Debug configuration.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 04:04:13 pm
This is not really an excuse... but yes, the next version of the website will use a bigger font size and have important paragraphs in red.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 09, 2012, 04:11:03 pm
Now works when run, but title doesn't

btw. can one library be so hard as this? Only problems after problems.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 04:23:24 pm
Title doesn't what? Are you sure that you didn't mix debug and release (i.e. linking release libs in debug mode)?

Quote
btw. can one library be so hard as this? Only problems after problems.
Are you kidding? The only problem is that you don't want to read the tutorial.
And SFML is not more complicated than any other library, the configuration steps required here are quite common.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: ekeimaja on October 09, 2012, 04:26:00 pm
I try again. Yes sorry, I'm just very tired and pissed.

And when I add  -d to .lib for debug mode, I get this error:


warning LNK4099: PDB 'sfml-main-d.pdb' was not found with 'sfml-main-d.lib(SFML_Main.cpp.obj)' or at 'C:\Users\ekeimaja\Desktop\sfml\Debug\sfml-main-d.pdb'; linking object as if no debug info C:\Users\ekeimaja\Desktop\sfml\sfml\sfml-main-d.lib(SFML_Main.cpp.obj)  sfml
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Laurent on October 09, 2012, 04:49:36 pm
This is not an error, just a normal warning (you didn't compile SFML so you don't have its debugging symbols). It has no effect on your application.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: xzbobzx on October 09, 2012, 05:27:55 pm
I'll just post this here I guess.

Uh, I tried the 2.0 installation tutorial on 2010 express, did everything it told me to, and got this:
http://www.sfml-dev.org/tutorials/2.0/start-vc.php

When I changed
int main()
to
int WinMain()
, as to see if that would fix it, I got this:
1>k:\yannic\bobstudios\projects\sfml_test_1\sfml_test_1\main.cpp(4): warning C4007: 'WinMain' : must be '__stdcall'
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

What am I doing wrong?
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: eXpl0it3r on October 09, 2012, 05:44:05 pm
Uh, I tried the 2.0 installation tutorial on 2010 express, did everything it told me to, and got this:
http://www.sfml-dev.org/tutorials/2.0/start-vc.php
Hu you got a link to the tutorial from the compiler? ???

What am I doing wrong?
Well you've answered that yourself already:

When I changed
int main()
to
int WinMain()
, as to see if that would fix it, I got this:
1>k:\yannic\bobstudios\projects\sfml_test_1\sfml_test_1\main.cpp(4): warning C4007: 'WinMain' : must be '__stdcall'
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

Don't just change the main() to WinMain() that's not how things work. ;D

If you want to get rid of the console window, then link against sfml-main.lib (or sfml-main-d.lib). ;)
IIRC that's also written in the tutorial somewhere.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: xzbobzx on October 09, 2012, 06:08:47 pm
Don't just change the main() to WinMain() that's not how things work. ;D

If you want to get rid of the console window, then link against sfml-main.lib (or sfml-main-d.lib). ;)
IIRC that's also written in the tutorial somewhere.

I do what now?
I added sfml-main-d.lib to the additional dependencies, but the console thing still shows.
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: eXpl0it3r on October 09, 2012, 06:14:18 pm
Ah sorry forgot to mention that you need to change the subsystem to /WINDOW
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: xzbobzx on October 09, 2012, 06:30:51 pm
Ah sorry forgot to mention that you need to change the subsystem to /WINDOW

Sorry for not knowing a lot, but where do I do this?

Thanks! That worked great.

Found it under Linker > System
Title: Re: SFML installing on Visual Studio 2010 Professional
Post by: Bubs on January 21, 2013, 09:45:59 am
Here is a youtube video (http://www.youtube.com/watch?v=PtSDrLpV74M&lc=vN6a9_S3nMRbdnAZCbG6HOKNt3j3yg3J7xCdRXZeDDE&context=C32d6917ADOEgsToPDskJ6DnT9LDtXlFctwZ7ePtn8) that I have found to be immensely helpful for setting up SFML 2.0 in VS2010. It should walk you through the entire process.

I got to the part where i was supposed to run nmake in the command prompt and it just comes up with 'fatal error U1064: MAKEFILE not found and no target specified'

There is definitely a makefile in the SMFL2 folder and when I added in the folder location it comes up with 'access denied'... Please help!!