emilk / loguru

A lightweight C++ logging library
The Unlicense
1.76k stars 256 forks source link

unresolved external symbol: write_date_time(char*, unsigned int) #210

Closed skaravos closed 2 years ago

skaravos commented 2 years ago

Calling loguru::write_date_time() function causes linker errors on systems where unsigned != size_t.

The declaration of write_date_time() uses unsigned for its buffer size and the definition in the .cpp uses size_t.

The function signature in loguru.cpp should be changed to match the header file.

skaravos commented 2 years ago

Actually it is probably better to change the function signature in the header file to use size_t. If you change the source file to be unsigned you'll get compilation warnings because the write_date_time() function is called with the result of strlen() (which is always size_t)