I am going through tutorial 33 of the SDL 2 tutorials on lazyfoo.net (source code is available at at the bottom of the page), and I am getting the compiler error "_Longlong was not declared in this scope". I am using g++ version 5.3 in Codeblocks 16.01. What can I do to resolve this build error?
1 Answer
This is like error (not-portable coding) in the example, as reported in by jungletek in 2015:
I posted this in a newer thread about the same issue, it's sad that people never follow up with their solutions on the internet...
Quote: I believe this is a combination of a MinGW bug (update MinGL to a newer version), and a bug/error(?) with Lazy Foo's code.
Changing all instances of '_Longlong' to 'long long' causes the code to compile properly, and the executable seems to perform as expected, as far as I can see. If anyone can let me know if this is in some way an incorrect solution, I'd love to hear it as I'm still very much in the process of learning.
Also make sure you're compiling for the c++11 standard, using the proper compiler flags.
So, you can try to add line (before first usage of _Longlong) with typedef of _Longlong into long long (both are 64 bit ints on many platforms):
typedef long long _Longlong;And the _Longlong sounds too much like something from desert of Redmond, WA, which is not the main target of gcc compiler.