Disappointed

Pages: 123
The book says to click on the latest stable version. Which is what I did. The website say they must match 100% So I am downloading 2017 community to see it this works better. The book says that I need 2019 which is what I have so it should work.
Since we're talking about SFML, it's worth mentioning there's an ongoing discussion about it in this thread: https://www.cplusplus.com/forum/windows/273546/4/#msg1180900
There's also a youtube tutorial that appears to do the correct steps in Visual Studio 2019.
As Albatross mentioned, the 2017 builds are compatible with VS 2019 (although personally I prefer to build everything myself).
Oh, so you have Beginning C++ Game Programming, 2nd Edition. That changes things. Disregard what I said.

I would still encourage you to try again from scratch, and follow your book's instructions as closely as possible. Amazon doesn't allow me to preview those instructions, so if you're still having issues after trying again, then I'd suggest either Ganado's link ( the Youtube video he's referencing is https://www.youtube.com/watch?v=xDg27l1hZ8w ) or SFML's own instructions.

-Albatross
Last edited on
What I’d like to know is what additional gems of Edwardian information are there in knowing about cancel culture.

I’ve never seen The Buzzard write so much before in her educative stardom quest. Hint: All of this jibber is much better organized and setout inthe Stack Overflow reading and tutorial thread. Hundreds of people have built it up and peer reviewed it instead of this scattergun dogs breakfast.
ok I am on the sfml website following their instructions. They lost me about half way down the page. So step by step instructions are no good on this site.
so ask. what is the instruction you got lost attempting? There is probably an assumption you know some things already that are glossed over. Libraries and setup etc are difficult the first few times you do those kinds of tasks.
Last edited on
Albatross. I followed the book to the letter and still have problems.
Of course you do @methman. You have to read whole words in the book not just letters.
@mathman54.

Compilers change, the language changes........ Even if the book was absolutely correct at the time of publication (and not all are), then it may not be correct now for the version(s) that you are using.

What are you doing, what are the problem(s), what isn't working that according to the book should be....
I went to this website https://www.sfml-dev.org/tutorials/2.5/start-vc.php and did most of what they recommended. But about half way down the page it started getting confusing. They stopped telling the reader what to do. I am posting here where I started getting lost. By the way I started a new solution and put just #include <SFML/graphics.hpp> and #include <iostream> and got sfml errors. The errors I got was cannot open SFML/graphics.hpp and cannot open include.
Here is the website stuff where I started getting confused.
Starting from SFML 2.2, when static linking, you will have to link all of SFML's dependencies to your project as well. This means that if you are linking sfml-window-s.lib or sfml-window-s-d.lib for example, you will also have to link opengl32.lib, winmm.lib and gdi32.lib. Some of these dependency libraries might already be listed under "Inherited values", but adding them again yourself shouldn't cause any problems.

Here are the dependencies of each module, append the -d as described above if you want to link the SFML debug libraries:

Module Dependencies
sfml-graphics-s.lib
sfml-window-s.lib
sfml-system-s.lib
opengl32.lib
freetype.lib
sfml-window-s.lib
sfml-system-s.lib
opengl32.lib
winmm.lib
gdi32.lib
sfml-audio-s.lib
sfml-system-s.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib
sfml-network-s.lib
sfml-system-s.lib
ws2_32.lib
sfml-system-s.lib
winmm.lib
You might have noticed from the table that SFML modules can also depend on one another, e.g. sfml-graphics-s.lib depends both on sfml-window-s.lib and sfml-system-s.lib. If you static link to an SFML library, make sure to link to the dependencies of the library in question, as well as the dependencies of the dependencies and so on. If anything along the dependency chain is missing, you will get linker errors.

If you are slightly confused, don't worry, it is perfectly normal for beginners to be overwhelmed by all this information regarding static linking. If something doesn't work for you the first time around, you can simply keep trying always bearing in mind what has been said above. If you still can't get static linking to work, you can check the FAQ and the forum for threads about static linking.

If you don't know the differences between dynamic (also called shared) and static libraries, and don't know which one to use, you can search for more information on the internet. There are many good articles/blogs/posts about them.

Your project is ready, let's write some code now to make sure that it works. Put the following code inside the main.cpp file:
I know it is a lot but I really want to get sfml working so I can start writing game code.
By the way I started a new solution and put just #include <SFML/graphics.hpp> and #include <iostream> and got sfml errors.
The instructions you linked explain how to configure the project so the compiler will know where SFML's headers and libraries are. Of course if you start from a blank project the compiler will not know where they are, because those options are per-project.

Here is the website stuff where I started getting confused.
[Huge block of text.]
Uh-huh. And what are we supposed to do with this? Do you have any specific questions?
How do I put the stuff I posted from the sfml website into C++ compiler?
--I removed comment because after reading it, it seemed hostile and contributed nothing to the conversation.
Last edited on
How do I put the stuff I posted from the sfml website into C++ compiler?

http://www.cplusplus.com/forum/lounge/271176/
It is part of becoming a programmer that you have to get to grips with your development tools. This includes the IDE, debugger etc. VS has a full-featured IDE including a comprehensive debugger. There's plenty of info available on-line (including MS) as to how to configure/use the VS IDE. Time spent learning this will pay dividends later. Also don't forget that books aren't always 100% correct - and that the IDE can change between versions. ie if a book is targeted at VS2017 then it might not be absolutely correct for VS2019 but it will be close.
mathman,
(1) You don't need to use static linking
(2) The only significant difference I can find between VS 2017 and VS 2019 for the tutorial is that the line,
the path to the SFML headers (<sfml-install-path>/include) to C/C++ » General » Additional Include Directories", is outdated.

This configuration is now located in:
Properties for your project --> VC++ Directories --> Include Directories

Other than that, it's just carefully following directions. Start with an empty project and add your own .cpp file. And there's the youtube video I already linked. /peace
Last edited on
Registered users can post here. Sign in or register to post.
Pages: 123