SFML and VS2010
Page 1 of 1
madmax17




Posts: 17744
Location: Croatia
PostPosted: Wed, 3rd Oct 2012 22:35    Post subject: SFML and VS2010
http://www.sfml-dev.org/tutorials/1.6/start-vc.php

Did exactly as instructed but the sample won't start, I'm constantly getting linker errors.



Tried them all, -d -s, just sfml-system.dll, nothing works.

Back to top
[mrt]
[Admin] Code Monkey



Posts: 1338

PostPosted: Thu, 4th Oct 2012 08:47    Post subject:
Paste the error messages please.

Also, did you set up your library paths correctly? Did you check the actual path that it contains the lib file?


teey
Back to top
madmax17




Posts: 17744
Location: Croatia
PostPosted: Thu, 4th Oct 2012 10:31    Post subject:
I think I'm gonna fold and give up, seems a lot of people are getting linker errors. You have to use -d libs for debug then -s for release or something, then you have to recompile all the dll's because of VS2010 seems it's meant for VS2008 Confused then you have to add something to the preprocessor, Jesus with dx all you do is include directory and add libs to the linker, I don't know why is this one such a pain in the ass.



"I like playing as the mushroom." | My Imdb ratings | My Best Games | Best actors | Best directors | Best musicians | Best women | Best Shows


Last edited by madmax17 on Thu, 4th Oct 2012 12:25; edited 1 time in total
Back to top
Frant
King's Bounty



Posts: 24433
Location: Your Mom
PostPosted: Thu, 4th Oct 2012 11:03    Post subject:
That's why I love managed code. C#.. Wink


Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!

"Thank you to God for making me an Atheist" - Ricky Gervais
Back to top
madmax17




Posts: 17744
Location: Croatia
PostPosted: Thu, 4th Oct 2012 12:26    Post subject:
Yeah me to, but this is for college and c++ subject, it really is the hardest language to learn.

I'll go with SDL then.
Back to top
Veki




Posts: 380
Location: Croatia
PostPosted: Thu, 4th Oct 2012 12:36    Post subject:
What exactly did you do?

I just tried this on my VS2010 Express and it worked from the first try.
I downloaded "SFML development files (headers / libraries / external libraries) - Windows - Visual C++ 2008 (7.20 MB)"
I did this :
1. Copy "Include" from zip file to C:\Program Files\Microsoft Visual Studio 10.0\VC\
2. Copy "lib" from zip to C:\Program Files\Microsoft Visual Studio 10.0\VC\
3. Project -> Properties - Linker -> Input - Additional dependencies - add "sfml-system.lib"

Their example program compiled without errors. I just added sfml-system.dll to project directory and the program run without errors.

EDIT :
SDL works the same. You'll have to download include and lib files and either put them in C:\Program Files\Microsoft Visual Studio 10.0\VC\ or add paths to them in all your projects that require it.


Beware of he who would deny you access to information, for in his heart he dreams himself your master.
Commisssioner Pravin Lal
"U.N. Declaration of Rights"
Back to top
madmax17




Posts: 17744
Location: Croatia
PostPosted: Thu, 4th Oct 2012 12:52    Post subject:
The 1.6 version? Or 2.0? I tried them both, but I have Ultimate 2010.

A yes, you tried the small program, that worked for me as well.

But try the one that has graphics.h (more complex example), then you have to include one of the libs with -d like graphics-d.lib, system-d.lib, windows-d.lib etc. which is weird, I also included the files without any -

Then after he stops bitchin' about missing libs it won't start, gives me a weird error.

SDL works fine I tried it yesterday you only include the two directories and that's it, I'm used to that. I'm not used to all this shit, in the instructions it even mentions the preprocesor, which I never used.

"Important: if you link against the dynamic libraries, you have to define the SFML_DYNAMIC macro in your project's settings. If you don't, you'll get linker errors when compiling your application. "

Link against the dynamic libraries, not sure if I'm doing that or not.
Back to top
BearishSun




Posts: 4484

PostPosted: Thu, 4th Oct 2012 14:23    Post subject:
How big are the .lib files? If they're just a few (dozen) KB it's likely they're dynamic and you also need to include .dll files next to your .exe. Otherwise they're static libs.

Also, you don't need to recompile VS2008 libraries to use them with VS2010 (Although, for anything else than a school project I suggest you do). Just change Platform Toolset under Configuration Properties->General to an earlier version.
Back to top
madmax17




Posts: 17744
Location: Croatia
PostPosted: Thu, 4th Oct 2012 15:14    Post subject:
They pretty much vary, the -d libs are up to 114kb, graphics-d is 114 kb but graphics-s is 6 mbytes.

The -d don't go higher than 114 kb while the smallest is 23 kb.
Back to top
BearishSun




Posts: 4484

PostPosted: Thu, 4th Oct 2012 15:34    Post subject:
If you tried recompiling the libraries yourself, I'd step back and instead use the original VS2008 precompiled files. Or if you're going to compile yourself make sure you compile as a static library. Dynamic libraries require a preprocessor macro as you mentioned, and possibly other steps that might go wrong if you're not sure what you're doing.

You can use the original VS2008 files if you change platform toolset property to vs90 in project settings.
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group