I had the same problem. My error messages were:
TarHeader.h:15:24: error: expected declaration specifiers or '...' before numeric constant
TarHeader.c:69:61: error: expected declaration specifiers or '...' before string constant
And the specific lines of code were:
* Line 15 in TarHeader.h:
#define TAR_BLOCK_SIZE 512
* Line 69 (v1) in TarHeader.c:
static_assert(TAR_BLOCK_SIZE == sizeof(tar_posix_header_t), "Incorrect header definition");
When I tried to change it I changed the includes in "TarHeader.c" (removed include of "TarHeader.h")
The line seems then like this (Line 69 (v2) in TarHeader.c)
static_assert(512== sizeof(tar_posix_header_t), "Incorrect header definition");
And the error codes changed:
TarHeader.c:69:15: error: expected declaration specifiers or '...' before numeric constant
TarHeader.c:69:50: error: expected declaration specifiers or '...' before string constant
When I removed line 65 of "TarHeader.c" no error was reported even with the previously used include.
The static assert was copied from another project (also in C) ane there was no problem. But it was a different compiler.
Solution:
Search for the use of these defines and see what use causes this problem.