Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling error for the Week0 Hello World Example #1

Open
adricortes opened this issue Apr 13, 2019 · 4 comments
Open

Compiling error for the Week0 Hello World Example #1

adricortes opened this issue Apr 13, 2019 · 4 comments

Comments

@adricortes
Copy link

There is an incompatibility between using "struct timespec" in the GNU compiler with the -std=c99 option (Linux OS). The compiler complains that

FLA_Clock.c: In function ‘FLA_Clock_helper’:
FLA_Clock.c:41:21: error: storage size of ‘ts’ isn’t known
struct timespec ts;

A quick fix that worked is using -std=gnu99 instead.

@rvdg
Copy link
Contributor

rvdg commented Apr 13, 2019 via email

@rvdg
Copy link
Contributor

rvdg commented Apr 13, 2019 via email

@adricortes
Copy link
Author

Robert,

It compiled fine removing -std=c99.
My GCC is the newest version (8.3), and according to the man page by default it uses the -std=gnu17 ("GNU dialect of ISO C17. This is the default for C code"). I found an explanation of the compiling error here https://gcc-help.gcc.gnu.narkive.com/8xCaKI6r/problem-with-struct-timespec-and-c99-standard
Following it I put #define _POSIX_C_SOURCE 199309L in the beginning of FLA_Clock.c and it worked fine with the -std=c99 options.

Best.
Adriano.

@rvdg
Copy link
Contributor

rvdg commented Apr 14, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants