Suckless patching, static variable in .h file error (C)

I was patching slock and came across a compilation error where the config.h had static variables that were not being recognized by the compiler when used in slock.c file.

Everything seems in order, the slock.c has #include config.h and the variable names in the header and application file are the same as well

Maybe someone with more knowledge in the C programming language can give some advice on the issue


I’m not a C programmer at all, but I though includes had to be defined with:

#include <config.h>

But I have also seen

#include "config.h"

used in some cases.

Increase your chances of solving your issue:

Provide Information:

Also it may be good to know what you are trying to compile ?
And what compiler you do use :wink:

Thank you for the replies @andreas85 and @Strit and sorry for the late response.
Thanks for providing the links regarding forum good practice, I will follow them the next time I use the forums.

I found what was causing the problem yesterday, After applying the patch, I forgot to remove the old config.h file. I am assuming that this prevented the generation of a new config.h file that included the changes from the applied patch.

simply :
rm config.h
and recompiling the program did the trick.

Thank you for the reply, I found the solution to my issue and mentioned it here :

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.