Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: When setting up SFML, produces alot of errors  (Read 11256 times)

0 Members and 1 Guest are viewing this topic.

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
When setting up SFML, produces alot of errors
« 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.

Cheers!

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: When setting up SFML, produces alot of errors
« Reply #1 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?)
« Last Edit: September 13, 2013, 04:43:17 am by Ixrec »

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: When setting up SFML, produces alot of errors
« Reply #2 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 - and it still comes up with the same errors. Please do help, and if you need any more info do ask

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: When setting up SFML, produces alot of errors
« Reply #3 on: September 13, 2013, 05:03:51 am »
Could you paste the actual compiler output then? ie, all of the errors?

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: When setting up SFML, produces alot of errors
« Reply #4 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!

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: When setting up SFML, produces alot of errors
« Reply #5 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.

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: When setting up SFML, produces alot of errors
« Reply #6 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

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: When setting up SFML, produces alot of errors
« Reply #7 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.

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: When setting up SFML, produces alot of errors
« Reply #8 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!

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: When setting up SFML, produces alot of errors
« Reply #9 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.
« Last Edit: September 13, 2013, 06:38:59 am by Ixrec »

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: When setting up SFML, produces alot of errors
« Reply #10 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!

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: When setting up SFML, produces alot of errors
« Reply #11 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)
« Last Edit: September 13, 2013, 06:57:12 am by Ixrec »

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: When setting up SFML, produces alot of errors
« Reply #12 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?

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: When setting up SFML, produces alot of errors
« Reply #13 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

TCVM

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: When setting up SFML, produces alot of errors
« Reply #14 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"