SFML community forums
Help => General => Topic started by: Gerald Bates on June 14, 2024, 01:20:05 pm
-
Hello everyone. I have a quick question about the console window being shown in both debug and release. Am I right in thinking that if I create an application and supply all the windows skeleton code and use WinMain(...), I can leave the debug as subsystem console and release as windows in visual studio? That way I only get a console for debug builds?
-
Yes, that should work.
If you use sfml-main, you even don't have to use WinMain yourself, but you can link it in release and not in debug
-
Thankyou eXpl0it3r, I did not know that. And it works, no need for winMain(). Now I have a console in debug build but not in release.
Just one annoying issue left in visual studio. In debug build I get loads of errors like this one:
warning LNK4099: PDB '' was not found with 'sfml-graphics-s-d.lib(BlendMode.obj)
Is this because I am using a different version of VS than what you built the binaries with? How can I stop these warnings?
-
It complains that it can't find match PDB files, which would contain debug symbols for the given library.
We don't ship PDB files with the pre-build binaries.
You can either ignore the warning or build SFML from source and then make sure to also copy over the PDB files.
-
I will deal with PDB issue shortly. I have installed cmake and compiled sfml from source, have static release and debug now. Setup my project and tried to build but have errors? It's the usual test program with a green circle in a window. Errors are:
error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'sf::VideoMode'
error C2665: 'sf::RenderWindow::RenderWindow': no overloaded function could convert all the argument types
error C2660: 'sf::WindowBase::pollEvent': function does not take 1 arguments
error C2039: 'type': is not a member of 'sf::Event'
Any ideas what's going on?
-
I have had a thought. Why don't I revert to using the pre-built binaries and copy over the pdb files from my build. Would that work?
-
You most likely built from master, which is the work-in-progress SFML 3 version.
You'd want to build from either the 2.6.x branch or the specific git tag.
I have had a thought. Why don't I revert to using the pre-built binaries and copy over the pdb files from my build. Would that work?
No, that wouldn't work.
-
Yes I built from master! eXpl0it3r You are seriously good and I appreciate your help. Will keep progressing and use the branch you suggested. I am a beginner at this.
-
All the best on your journey! :)
-
Managed to download correct SFML version and run CMAKE to build static debug/release versions. The typical test example (green circle) works. I am also able to change whether I want to see the console in either debug or release versions without errors, so debug has a console and release doesn't. I don't get PDB errors anymore either.
Thanks eXpl0it3r for all your help, appreciated.
-
That's great to hear!
No problem :)