paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
3.03k stars 814 forks source link

MSVC linker issue when using static version of a library #256

Open nickaleks opened 4 years ago

nickaleks commented 4 years ago

In my current porject, node editor is used a static library. It's used in a dynamic library which is then linked to a test executable. Since I use classes from the library in a test, I am forced to include their headers. This transitively includes header from node editor (such as NodeDataModel). Since a lot of headers have class members definitions inline, this causes definition of those methods to be included both in DLL and the the test's executable.

On Linux, this is resolved via weak symbols, and everything is fine, however on windows, this causes linker to fail with an error about multiple definitions. Is it possible to move definitions inside a source file, so that these sorts of issues do not appear?