Closed csaez closed 9 years ago
In the interest of learning, would it be possible to include a little description of the changes?
Before C99, you had to define the local variables at the start of a block. C99 imported the C++ feature that you can intermix local variable definitions with the instructions and you can define variables in the for
and while
control expressions.
By default, gcc
does not conform to any of the ANSI/ISO C standards. The current default is equivalent to -std=gnu90
, which is the 1989/1990 standard with GNU-specific extensions.
tl;dr
@Byron's code works fine as long as you explicity compile in C99 mode (or higher) using the flag -std=C99
, changes allow to compile using gnu90 (gcc's default).
And I have kind of overwritten these changes when I re-recorded the screencast. Maybe at some point, we add a build system that 'does it correctly' on all platforms, or everyone builds with qt-creator for now which uses a C++ compiler (unfortunately).
You can create a Makefile from qtcreator project files (.pro
) usingqmake
:+1:
I have recommended the use of a standard building system since we started sharing code without much luck (everyone wants to use a homemade script), perhaps screencasts are able to make a better case.
Thanks, why not !