tapio / rlutil

C and C++ utilities for cross-platform console roguelike game creation.
http://tapio.github.com/rlutil/
229 stars 42 forks source link

Multiple definition of const RLUTIL_STRING_T ANSI_CLS[...] #51

Open bitsydoge opened 7 years ago

bitsydoge commented 7 years ago

Hello, I tried to use rlutil.h in C, but when I include it in multiple file, "const RLUTIL_STRINGT ANSI[..]" have multiple declaration, so I had to make a rlutil.c with the declaration of the variables and making them extern on the header.

for the .h extern const RLUTIL_STRING_T ANSI_CLS; for the .c const RLUTIL_STRING_T ANSI_CLS = "\033[2J\033[3J";

It is better explained on a answerd on my stack question.

https://stackoverflow.com/questions/46591356/c-guard-not-work-as-intended-with-rlutil-h/46592048#46592048