SFML Render Screen not Visible - sfml

I've downloaded this code : https://github.com/AlexZihaoXu/CppFlappyBird
I used DevC++ with SFML.
Compiler Gives 0 Errors.
but when I run it it displays nothing.

Related

Cannot open source file "glad/gl.h" GLFW OPENGL

It keeps showing this error Error I cannot figure out why, I am using VSCODE the newest version, here is my C/C++ Properties json: c_cpp_properties.json I have it set up all correctly according to tutorials. files
I can't get rid of this error no matter how much I try,
According to the image you provided, there is no glad/gl.h in your project
are you sure you are looking for <glad/gl.h> and not <glad/glad.h> ?

Why does QtCreator complain about missing <algorithm>

I can't compile anything in QtCreator - not even a standard QWidget example application. On compilation I get:/usr/include/qt5/QtCore/qglobal.h:82: error: algorithm: No such file or directory and it sets the cursor toline 82 in global.h at #include <algorithm> - why is this, what is missing on this machine?
UPDATE:
What I did: I created a project using QtCreator on another computer which works & compiles fine. I copied it to this one, tried to start it but get an error:: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: versionGLIBCXX_ 3.4.21' not found (required by- hence I then tried to recompiled it with the provided Makefile but I get a whole buch of errors (pages or errors). So My intention was to fire upQtCreator` and see if i can compile it from within but no dough due to the above error....What's going on and how do I get things back in order?

SFML loadFromFile undefined reference

I'm learning to use SFML with the idea of making a small game, so far I've created a window and messed about with it's settings, and set up a draw loop and event handler.
The trouble started once I tried to add my first texture using the following code:
#include "SpaceNomad.ih"
void MainMenu(GameEngine &Engine)
{
sf::Texture texture;
if(!texture.loadFromFile("MenuBackGround.png"))
{
cout << "couldn't load background texture\n";
}
sf::Sprite *sprite = new sf::Sprite;
sprite->setTexture(texture);
Engine.AddEntity(sprite, 5);
}
which is outside of a different image literally the example code given on the SFML tutorial page.
When I try to compile this I get the following error:
||=== Build: Debug in space nomad (compiler: GNU GCC Compiler) ===|
obj\Debug\projects\st\take2\MainMenu.o||In function `Z8MainMenuR10GameEngine':|
D:\projects\st\take2\MainMenu.cpp|7|undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_4RectIiEE'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
I have checked that all the sfml libraries are included in the build options(I'm using code::Blocks with GCC MinGW).
https://drive.google.com/file/d/0B4qzXcgqbLZtcHJWUy1vSUhpdVk/view?usp=sharing
Other topics I've seen deal with undefined references to functions people have made themselves, but here I'm using a library.
edit: I've just tried with the basic shape from the same libary:
sf::CircleShape *shape = new sf::CircleShape(50);
// set the shape color to green
shape->setFillColor(sf::Color(100, 250, 50));
Engine.AddEntity(shape, 5);
Which compiles and displays without a problem.
You're using SFML libraries which were compiled with a different runtime or a different runtime ABI than you link your application against.
If your SFML libraries weren't compiled with the same compiler that you have, then you need to rebuild.
If you have set any special flags on your application (e.g. different ABI, C++14, etc.) you'll have to rebuild SFML with the same flags as well or remove them from your project.
Also it only happens sometimes because it doesn't affect the whole runtime libraries but parts like std::string which get used when calling the loadFromFile function.

Cocos2D 3.1 Xcode 4.5.2 Default project not compile

I have Xcode 4.5.2 and I installed Cocos2D 3.1.0. When I create a project, the default code doesn't compile. I have the error ARC Semantic Issue : No visible #interface for 'CCNode' declares the selector 'wasRunning'. There is the function -(void)wasRunning:(BOOL)wasRunning in CCNode.m but it's not declared in CCNode.h. So I put it in CCNode.h or move the function in CCNode.m at the beginning of CCNode.m, and the error disappears.
Then I have another error in CCScheduler.m : 'CCScheduledTarget' does not have a member named '_paused'. As I don't want to modify a DEFAULT project like that, I gave up to ask why I have those errors in a default project and how to correct them correctly?

GL_COLOR_BUFFER_BIT and many more show "undeclared identifier by Xcode

I am trying run Apple documentation sample code, placed on this link...
Sample Code
However when I run this code XCode fails to compile. It shows several error stating that below listed variables are not defined.
GL_COLOR_BUFFER_BIT
GL_VIEWPORT
GL_PROJECTION
GL_MODELVIEW
GL_QUADS
My understanding is, it is obvious that Xcode couldn't fins this const variables and it seems like they are from OpenGL framework. I checked my imported framework list it have OpenGL in it.
How to solve this?
Environment :
OS version : MacOSX 10.7.3
Base SDK of the project : MacOSX SDK 10.7
Compiler : Defualt LLVC GCC 4.2
Just add
#import <OpenGL/gl.h>
to the file NormalGLView.m (at the top of the file, after the other import). That fixed it for me...
The problem was not that it couldn't find the framework, but it couldn't find the definitions, indicating that a header file might be missing