When I want to compile it (in kubuntu 20.04) with this command: cc -lX11 blocks.h dwmblocks.c -o dwmblocks
it says:
cc -lX11 blocks.h dwmblocks.c -o dwmblocks
blocks.h:2:14: error: unknown type name ‘Block’
2 | static const Block blocks[] = {
| ^~~~~
blocks.h:4:2: warning: braces around scalar initializer
4 | {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0},
| ^
blocks.h:4:2: note: (near initialization for ‘blocks[0]’)
blocks.h:4:3: warning: initialization of ‘int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
4 | {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0},
| ^~~~~~
blocks.h:4:3: note: (near initialization for ‘blocks[0]’)
blocks.h:4:3: error: initializer element is not computable at load time
blocks.h:4:3: note: (near initialization for ‘blocks[0]’)
blocks.h:4:11: warning: excess elements in scalar initializer
4 | {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0},
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
blocks.h:4:11: note: (near initialization for ‘blocks[0]’)
blocks.h:4:70: warning: excess elements in scalar initializer
4 | {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0},
| ^~
blocks.h:4:70: note: (near initialization for ‘blocks[0]’)
blocks.h:4:75: warning: excess elements in scalar initializer
4 | {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g", 30, 0},
| ^
blocks.h:4:75: note: (near initialization for ‘blocks[0]’)
blocks.h:6:2: warning: braces around scalar initializer
6 | {"", "date '+%b %d (%a) %I:%M%p'", 5, 0},
| ^
blocks.h:6:2: note: (near initialization for ‘blocks[1]’)
blocks.h:6:3: warning: initialization of ‘int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
6 | {"", "date '+%b %d (%a) %I:%M%p'", 5, 0},
| ^~
blocks.h:6:3: note: (near initialization for ‘blocks[1]’)
blocks.h:6:3: error: initializer element is not computable at load time
blocks.h:6:3: note: (near initialization for ‘blocks[1]’)
blocks.h:6:7: warning: excess elements in scalar initializer
6 | {"", "date '+%b %d (%a) %I:%M%p'", 5, 0},
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
blocks.h:6:7: note: (near initialization for ‘blocks[1]’)
blocks.h:6:41: warning: excess elements in scalar initializer
6 | {"", "date '+%b %d (%a) %I:%M%p'", 5, 0},
| ^
blocks.h:6:41: note: (near initialization for ‘blocks[1]’)
blocks.h:6:45: warning: excess elements in scalar initializer
6 | {"", "date '+%b %d (%a) %I:%M%p'", 5, 0},
| ^
blocks.h:6:45: note: (near initialization for ‘blocks[1]’)