fungos / cr

cr.h: A Simple C Hot Reload Header-only Library
https://fungos.github.io/cr-simple-c-hot-reload/
MIT License
1.54k stars 101 forks source link

multiple definition issue #55

Closed alexxbb closed 4 years ago

alexxbb commented 4 years ago

Hi. Thank you for this project, it's exactly what I was looking for, however I'm stuck with the linker errors:

multiple definition of cr_plugin_open; CMakeFiles/hrust_sop.dir/plugin_manager.cpp.o .... same for all other **crplugin*** symbols

What I can figure out is how cr.h is getting into all of my compilation units.

I should say that I include cr.h into my header, which is then gets included in a few other places (with guards). I suspect cr.h can not be included into headers, but instead should be only used in a cpp file?

I will appreciate any help,

Alex

fungos commented 4 years ago

Sorry, I didn't see this one. Yes, you shouldn't include cr.h in header files. Keep it in only one c/cpp file or put ifdef guards if you really need it.