rxi / microui

A tiny immediate-mode UI library
MIT License
3.29k stars 239 forks source link

Hash function "Cannot convert from 'const void *' to 'const unsigned char *'" #42

Closed WillCecil closed 3 years ago

WillCecil commented 3 years ago

I'm running into an issue when building microui in a C++ project in visual studio 2019.

The two errors that show are one in the hash() function: "Cannot convert from 'const void ' to 'const unsigned char '"

And another in the mu_next_command() function: "Cannot convert from 'void ' to 'mu_Command '"

Any idea what might be going wrong?

g012 commented 3 years ago

Yes, you're compiling in C++. void* implicit casts are illegal in C++. Compile microui as C (/TC if I recall in VS).

WillCecil commented 3 years ago

Ahh, gotcha. Is it possible to compile microui in a C++ project?

g012 commented 3 years ago

I think yes, just specify /TC on microui C files in the build flags for them (right click on the C files, properties / build options, Compile As -> C).

WillCecil commented 3 years ago

Hmm. I'm still running into issues but I don't think it's to do with microui, so I'll close this. Thanks for getting me pointed in the right direction!