Multi-character constant warnings

According to the standard (§6.4.4.4/10) The value of an integer character constant containing more than one character (e.g., ‘ab’), […] is implementation-defined. This is valid ISO 9899:2011 C. It compiles without warning under gcc with -Wall, and a “multi-character character constant” warning with -pedantic. From Wikipedia: Multi-character constants (e.g. ‘xy’) are valid, although rarely useful … Read more

Program received signal SIGSEGV, Segmentation fault

If you are on Linux, try running valgrind. You just compile with -g (with gcc), and then run your program with valgrind in front: Unlike the GCC solutions, which tell you when the segfault occurs, valgrind usually tells you exactly when the first memory corruption occurs, so you can catch the problem much closer to its source. PS. It rhymes … Read more

error C2679: binary ‘<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

You forgot to #include <string> using std::string without including it’s header works on some compilers that indirectly import parts of <string> into their <iostream> or other headers but that’s not standard and shouldn’t be relied upon. Also they often break when you try to output a string since they only included a part of the … Read more

c++ “Incomplete type not allowed” error accessing class reference information (Circular dependency with forward declaration)

If you will place your definitions in this order then the code will be compiled The definition of function doSomething requires the complete definition of class Ball because it access its data member. In your code example module Player.cpp has no access to the definition of class Ball so the compiler issues an error.