Nelarius / imnodes

A small, dependency-free node editor for dear imgui
MIT License
2.01k stars 244 forks source link

Exporting symbols for dll usage #201

Open aconstlink opened 1 month ago

aconstlink commented 1 month ago

If imnodes is used as a dll, all symbols need to be exported. One purpose is that the imnodes context is then only created once in the dll and used through the exported symbols.

So IMNODES_API will be __declspec( dllexport ) or __declspec( dllimport ) depending on how the lib is used. Symbols are exported if the lib is compiled. Import is used if the lib is linked against. This is done by the imnodes user though and not the imnodes maintainer, so by default IMNODES_API is empty.

Specifying the correct declspec can be done using a custom imnodes_config.h file using the libs directive IMNODES_USER_CONFIG.