SFML community forums

Help => General => Topic started by: TCVM on September 13, 2013, 04:35:58 am

Title: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 04:35:58 am
Hello again, I have tried to re-install SFML and when debugging in Visual Studio 2012 it will produce alot of errors. Now, I have tried again and again but it will still produce these errors. Essentially, the errors are saying that in the actual project files (sfml-audio, sfml-graphics etc), there are missing semi-colons and that. There is another error though, it says "m_info is not a member of s_font", and there are many more like that. Now, I am going to say it is probably me missing a step with CMake. I have used this tutorial http://www.cplusplus.com/forum/beginner/95295/#msg511542 (http://www.cplusplus.com/forum/beginner/95295/#msg511542).

Cheers!
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 04:41:29 am
Considering it says 2.0 is still a work in progress, that tutorial is clearly way out of date.

I got into SFML after 2.0 came out and honestly, I've never felt there was anything lacking in any of the official setup tutorials on this site (I've used the CMake and Visual Studio ones myself) and about half of the new topics on this forum are people who very obviously did not read the official tutorials carefully, because they failed to do something explicitly stated in the tutorials.  So I'm confident those tutorials really do cover *all* of the common gotchas.

tl;dr, use the official tutorials because they don't suck (...anymore?)
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 05:02:06 am
Ok, now I went by this tutorial - http://www.sfml-dev.org/tutorials/2.1/compile-with-cmake.php (http://www.sfml-dev.org/tutorials/2.1/compile-with-cmake.php) - and it still comes up with the same errors. Please do help, and if you need any more info do ask
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 05:03:51 am
Could you paste the actual compiler output then? ie, all of the errors?
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 05:14:45 am
Code: [Select]
Error 24 error C2039: 'getInfo' : is not a member of 'sf::Font' C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 252 1 sfml-graphics
Error 21 error C2039: 'Info' : is not a member of 'sf::Font' C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 252 1 sfml-graphics
Error 13 error C2039: 'm_info' : is not a member of 'sf::Font' C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 83 1 sfml-graphics
Error 5 error C2039: 'setProcessingInterval' : is not a member of 'sf::SoundRecorder' C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Audio\SoundRecorder.cpp 133 1 sfml-audio
Error 15 error C2065: 'm_info' : undeclared identifier C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 139 1 sfml-graphics
Error 17 error C2065: 'm_info' : undeclared identifier C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 182 1 sfml-graphics
Error 19 error C2065: 'm_info' : undeclared identifier C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 245 1 sfml-graphics
Error 27 error C2065: 'm_info' : undeclared identifier C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 254 1 sfml-graphics
Error 6 error C2065: 'm_processingInterval' : undeclared identifier C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Audio\SoundRecorder.cpp 135 1 sfml-audio
Error 7 error C2065: 'm_processingInterval' : undeclared identifier C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Audio\SoundRecorder.cpp 163 1 sfml-audio
Error 23 error C2143: syntax error : missing ';' before '&' C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 252 1 sfml-graphics
Error 16 error C2228: left of '.family' must have class/struct/union C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 139 1 sfml-graphics
Error 18 error C2228: left of '.family' must have class/struct/union C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 182 1 sfml-graphics
Error 20 error C2228: left of '.family' must have class/struct/union C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 245 1 sfml-graphics
Error 25 error C2270: 'getInfo' : modifiers not allowed on nonmember functions C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 253 1 sfml-graphics
Error 12 error C2614: 'sf::Font' : illegal member initialization: 'm_info' is not a base or member C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 72 1 sfml-graphics
Error 14 error C2614: 'sf::Font' : illegal member initialization: 'm_info' is not a base or member C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 86 1 sfml-graphics
Error 4 error C2614: 'sf::SoundRecorder' : illegal member initialization: 'm_processingInterval' is not a base or member C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Audio\SoundRecorder.cpp 52 1 sfml-audio
Error 22 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 252 1 sfml-graphics
Error 26 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Font.cpp 253 1 sfml-graphics
Warning 28 warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\stb_image\stb_image.h 760 1 sfml-graphics
Warning 29 warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\stb_image\stb_image.h 773 1 sfml-graphics
Warning 30 warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\stb_image\stb_image_write.h 321 1 sfml-graphics
Warning 31 warning C4244: 'initializing' : conversion from 'unsigned int' to 'float', possible loss of data C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Graphics\Text.cpp 254 1 sfml-graphics
Warning 1 warning C4267: 'argument' : conversion from 'size_t' to 'sf::Int32', possible loss of data C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Audio\SoundBuffer.cpp 256 1 sfml-audio
Warning 2 warning C4267: 'initializing' : conversion from 'size_t' to 'sf::Uint32', possible loss of data C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Network\Packet.cpp 408 1 sfml-network
Warning 3 warning C4267: 'initializing' : conversion from 'size_t' to 'sf::Uint32', possible loss of data C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\src\SFML\Network\Packet.cpp 437 1 sfml-network
Warning 8 warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in opengl32.lib(OPENGL32.dll); second definition ignored C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\builds\src\SFML\Window\winmm.lib(WINMM.dll) sfml-window
Warning 10 warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in opengl32.lib(OPENGL32.dll); second definition ignored C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\builds\src\SFML\Window\gdi32.lib(GDI32.dll) sfml-window
Warning 9 warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\builds\src\SFML\Window\winmm.lib(WINMM.dll) sfml-window
Warning 11 warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFML-master\builds\src\SFML\Window\gdi32.lib(GDI32.dll) sfml-window

There you go

Cheers!
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 05:25:24 am
Do you have anything from SFML 1.6 floating around?  Because some of those errors are occurring on lines where according to my source they just can't, eg the "missing type specifier" errors happen on lines consisting solely of "{" and a comment.
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 05:29:42 am
I do not believe so, but I did download it from the respiratory because that's the only place I can find the download with Cmakelists. Then I proceeded to download 2.1 and merge the folders. I assume that wasn't correct
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 05:31:33 am
You should probably download from the official download page http://www.sfml-dev.org/download/sfml/2.1/ unless you want to play with the nightly builds.  That download definitely has the Cmakelists.
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 05:36:52 am
I am sad to say, but the download (32 AND 64 bit versions) do NOT include CmakeLists. I would appreciate it it someone could upload it to a file hosting site for me to download. Please

Cheers!
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 06:35:42 am
You're supposed to be downloading the source code.  You don't need CMake if you aren't compiling SFML yourself.
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 06:47:22 am
Thank you, I did not know that. Now, is the file "All Build" needed? Because all I see in it is the cmakelists text file

Cheers!
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 06:52:11 am
Just use the official tutorial for compiling with CMake.  If it's not in there, you probably don't need to know.

Edit: I don't see "All Builds" anywhere in the source code download (did a mass search). Where are you seeing it?
(not that it has any relevance to using CMake, but if you're seeing stuff I'm not that implies we've still got different files)
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 07:02:00 am
Ah, it's ok. It did seem to work without that file being open. Anyway, when compiling the folders it didn't decide to make a lib file in the root of SFML. Would this be Cmake or me being stupid?
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 07:35:15 am
1) as the tutorial says, the BUILD_SHARED_LIBS setting decides whether it links statically or dynamically

2) I believe it puts *all* the files in the build folder you specify, which probably shouldn't be SFML/lib
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 04:10:11 pm
Okay, so, I followed the main tutorial many times. Now, it decides to throw me a "Your program cannot start becasue sfml-graphics-d-2.dll is missing from your computer. Try reinstalling the program and try again". After I tried to drag all the .dll to my executible (I didn't link SFML staticly), it now says "The app wasn't able to start correctly. (0xc0000007b). Click ok to close the app"
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 08:37:14 pm
What program is failing to start?

(you need to provide way more information than that if you want us to figure out what's wrong)
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 08:44:19 pm
Sorry, I thought it was assumed when I said that. I was making the program in the tutorial here - http://www.sfml-dev.org/tutorials/2.0/start-vc.php (http://www.sfml-dev.org/tutorials/2.0/start-vc.php) -. Now, I followed the tutorial step by step multiple times. Now, the program starts but that error code appears
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 08:47:47 pm
I thought it'd be one of the example programs that come with the source code.  In fact I had no idea VS was involved.

Did you compile it in debug mode?  Could you run it in debug mode so we get a meaningful error message?
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 09:00:40 pm
This is the only output I can find, otherwise the other error code I posted

Code: [Select]
'SFMLTestA.exe' (Win32): Loaded 'C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLTestA\Debug\SFMLTestA.exe'. Symbols loaded.
'SFMLTestA.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'SFMLTestA.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'SFMLTestA.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'SFMLTestA.exe' (Win32): Loaded 'C:\ProgramData\Norton\{0C55C096-0F1D-4F28-AAA2-85EF591126E7}\N360_20.3.0.36\Definitions\BASHDefs\20130903.002\UMEngx86.dll'. Cannot find or open the PDB file.
The program '[9460] SFMLTestA.exe' has exited with code -1073741701 (0xc000007b).

That is the only output I can find
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 13, 2013, 09:38:05 pm
It won't even tell you what statement it exits on?

Step through it with the debugger to get more info.
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 09:44:03 pm
No, it doesnt say what it ends on. I have no idea why. And I am running it with the debugger, and that's all that shows. Please do tell me if you mean something else

Also, the console loads (it is a console app), but it will just pop up an error box saying "The program '[4428] SFMLTestA.exe' has exited with code -1073741701 (0xc000007b)."

Cheers!
Title: Re: When setting up SFML, produces alot of errors
Post by: eXpl0it3r on September 13, 2013, 09:57:32 pm
Also, the console loads (it is a console app), but it will just pop up an error box saying "The program '[4428] SFMLTestA.exe' has exited with code -1073741701 (0xc000007b)."
Then you're most likely not running it through the debugger, otherwise the application would halt at the crash location.

Have you made sure that you don't mix debug/release modes/libraries?
You're still using the code from the tutorial, right?
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 13, 2013, 10:05:59 pm
sfml-graphics.lib is release, and sfml-graphics-d.lib is debug? If so, yes. And also, when using the release debug, thing,  it does error with
Code: [Select]
Error 1 error LNK1181: cannot open input file 'sfml-graphics.lib' C:\Users\Brandon Danyluk\Desktop\C++ Game Making (SFML)\SFMLTestA\SFMLTestA\LINK SFMLTestA
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 14, 2013, 10:35:15 pm
Hello again, now when using release it says

Code: [Select]
The program can't start because sfml-graphics-2.dll is missing from your computer. Try reinstalling the program to fix this problem
I have the file in my bin folder, and my folder where the exe is.
Title: Re: When setting up SFML, produces alot of errors
Post by: Ixrec on September 14, 2013, 10:53:32 pm
I'm pretty sure the .dlls should be in the same folder as the .exe, not inside an additional folder.
Title: Re: When setting up SFML, produces alot of errors
Post by: TCVM on September 14, 2013, 10:59:39 pm
Thanks! It now works! Now, for future reference - Copy all DLL's to the executible. I just had to copy the DEBUG dlls aswell. As in sfml-graphics-d.dll.

Thanks for all the help!
Title: Re: When setting up SFML, produces alot of errors
Post by: Laurent on September 14, 2013, 11:17:51 pm
Quote
Now, for future reference - Copy all DLL's to the executible.
Or just read the tutorials.