Reputation: 155
I decided to try with SFML again but here is when a new update comes and you don't know what to do. I managed to find how to setup my SFML but here the error is when i start the program
sf::RenderWindow window(sf::VideoMode(width, height, 32), "Example");
and here is a photo of the error and the code
I tried fixing it but still noting, i watched tutorials pictures of the code examples but noting happened again. i hope you can help me with this problem.
after compiling it i got this many errors
Severity Code Description Project File Line Column Suppression State Error (active) E1696 cannot open source file "vector" MoonSurvival c:\SFML-2.4.2\include\SFML\Window\VideoMode.hpp 32 1
Error C1083 Cannot open include file: 'ostream': No such file or directory MoonSurvival C:\SFML-2.4.2\include\SFML\System\Err.hpp 32 1
Error (active) E0018 expected a ')' MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 150 35
Error (active) E0020 identifier "Iterator" is undefined MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 479 5
Error (active) E0020 identifier "ConstIterator" is undefined MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 489 5
Error (active) E0020 identifier "Iterator" is undefined MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 503 5
Error (active) E0020 identifier "ConstIterator" is undefined MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 517 5
Error (active) E0065 expected a ';' MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 52 30
Error (active) E0065 expected a ';' MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 53 30
Error (active) E0065 expected a ';' MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 276 22
Error (active) E0065 expected a ';' MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 286 22
Error (active) E0065 expected a ';' MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 299 22
Error (active) E0065 expected a ';' MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 527 22
Error (active) E0077 this declaration has no storage class or type specifier MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 276 5
Error (active) E0077 this declaration has no storage class or type specifier MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 286 5
Error (active) E0077 this declaration has no storage class or type specifier MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 299 5
Error (active) E0077 this declaration has no storage class or type specifier MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 527 5
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Glsl.inl 40 61
Error (active) E0135 namespace "std" has no member "string" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Texture.hpp 127 34
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Texture.hpp 159 48
Error (active) E0135 namespace "std" has no member "ostream" MoonSurvival c:\SFML-2.4.2\include\SFML\System\Err.hpp 41 22
Error (active) E0135 namespace "std" has no member "basic_string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 52 18
Error (active) E0135 namespace "std" has no member "basic_string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 53 18
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 58 23
Error (active) E0135 namespace "std" has no member "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 78 38
Error (active) E0135 namespace "std" has no member "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 78 60
Error (active) E0135 namespace "std" has no member "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 106 47
Error (active) E0135 namespace "std" has no member "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 106 69
Error (active) E0135 namespace "std" has no member "string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 118 23
Error (active) E0135 namespace "std" has no member "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 118 54
Error (active) E0135 namespace "std" has no member "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 118 76
Error (active) E0135 namespace "std" has no member "wstring" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 134 23
Error (active) E0135 namespace "std" has no member "string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 253 10
Error (active) E0135 namespace "std" has no member "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 253 41
Error (active) E0135 namespace "std" has no member "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 253 63
Error (active) E0135 namespace "std" has no member "wstring" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 266 10
Error (active) E0135 namespace "std" has no member "basic_string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 276 10
Error (active) E0135 namespace "std" has no member "basic_string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 286 10
Error (active) E0135 namespace "std" has no member "basic_string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 299 10
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 332 29
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 345 30
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 365 10
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 387 21
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 387 43
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 399 22
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 413 10
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 413 46
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 427 23
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 427 45
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 456 27
Error (active) E0135 namespace "std" has no member "size_t" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 456 49
Error (active) E0135 namespace "std" has no member "basic_string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 527 10
Error (active) E0260 explicit type is missing ('int' assumed) MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 52 13
Error (active) E0260 explicit type is missing ('int' assumed) MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 53 13
Error (active) E0260 explicit type is missing ('int' assumed) MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 150 18
Error (active) E0260 explicit type is missing ('int' assumed) MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 221 5
Error (active) E0260 explicit type is missing ('int' assumed) MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 236 5
Error (active) E0289 no instance of constructor "sf::RenderWindow::RenderWindow" matches the argument list MoonSurvival c:\Users\Kids\source\repos\MoonSurvival\MoonSurvival\Launcher.cpp 17 26
Error (active) E0297 expected an operator MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 221 14
Error (active) E0297 expected an operator MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 236 14
Error (active) E1696 cannot open source file "vector" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\ConvexShape.hpp 33 1
Error (active) E1696 cannot open source file "map" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Font.hpp 37 1
Error (active) E1696 cannot open source file "string" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Font.hpp 38 1
Error (active) E1696 cannot open source file "vector" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Font.hpp 39 1
Error (active) E1696 cannot open source file "string" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Image.hpp 34 1
Error (active) E1696 cannot open source file "vector" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Image.hpp 35 1
Error (active) E1696 cannot open source file "algorithm" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Rect.hpp 32 1
Error (active) E1696 cannot open source file "string" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\RenderWindow.hpp 35 1
Error (active) E1696 cannot open source file "map" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Shader.hpp 37 1
Error (active) E1696 cannot open source file "string" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Shader.hpp 38 1
Error (active) E1696 cannot open source file "string" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Text.hpp 38 1
Error (active) E1696 cannot open source file "vector" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\Text.hpp 39 1
Error (active) E1696 cannot open source file "vector" MoonSurvival c:\SFML-2.4.2\include\SFML\Graphics\VertexArray.hpp 36 1
Error (active) E1696 cannot open source file "ostream" MoonSurvival c:\SFML-2.4.2\include\SFML\System\Err.hpp 32 1
Error (active) E1696 cannot open source file "cstdio" MoonSurvival c:\SFML-2.4.2\include\SFML\System\FileInputStream.hpp 35 1
Error (active) E1696 cannot open source file "string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\FileInputStream.hpp 36 1
Error (active) E1696 cannot open source file "cstdlib" MoonSurvival c:\SFML-2.4.2\include\SFML\System\MemoryInputStream.hpp 34 1
Error (active) E1696 cannot open source file "iterator" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 33 1
Error (active) E1696 cannot open source file "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 34 1
Error (active) E1696 cannot open source file "string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\String.hpp 35 1
Error (active) E1696 cannot open source file "cstdlib" MoonSurvival c:\SFML-2.4.2\include\SFML\System\Thread.hpp 33 1
Error (active) E1696 cannot open source file "cstdlib" MoonSurvival c:\SFML-2.4.2\include\SFML\System\ThreadLocal.hpp 33 1
Error (active) E1696 cannot open source file "algorithm" MoonSurvival c:\SFML-2.4.2\include\SFML\System\Utf.hpp 32 1
Error (active) E1696 cannot open source file "locale" MoonSurvival c:\SFML-2.4.2\include\SFML\System\Utf.hpp 33 1
Error (active) E1696 cannot open source file "string" MoonSurvival c:\SFML-2.4.2\include\SFML\System\Utf.hpp 34 1
Error (active) E1696 cannot open source file "cstdlib" MoonSurvival c:\SFML-2.4.2\include\SFML\System\Utf.hpp 35 1
and its really big, but when i saw it i touch maybe its because my project is on release not debug? i will try but for now that's the error.
[FINAL GOOD EDIT] everything is just fine maybe i have deleted something in the properties window but i made new project and everything is just fine
Upvotes: 0
Views: 1404
Reputation: 101
Do the following: the compiler complains about the types of the arguments passed to videoMode, as it identifies them as integers, it basically fails to construct a Vector2u, if you create a Vector2u with '{}' preventing narrowing it will work., note that the third argument passed to the VideoMode is optional, in this case I skipped it.
sf::RenderWindow window(sf::VideoMode({200,200}), "SFML works!");
sf::CircleShape shape(100.f);
As a side note you may want to check the slash in the includes I think it should be:
#include <SFML/Graphics.hpp>
not
#include <SFML\Graphics.hpp>
and also use C++17 or newer, as otherwise some things will fail, in my case I was using VS2022 and the default version is C++14. So optional was not part of the standard.
Upvotes: 1