OGRECave / ogitor

Ogitor SceneBuilder, the WYSIWYG scene editing environment for OGRE
MIT License
95 stars 31 forks source link

MSVC build broken #14

Closed Fighter19 closed 4 years ago

Fighter19 commented 5 years ago

When building with MSVC (14.1 / 2017) an error occurs, as the classes imported via dllimport have static members.

error C2491: "Ogitors::CBillboardSetEditorFactory::mBillboardTypes": definition of dllimport function for static members not allowed

(Not the actual message, but translated)

kPYKx7Ddw4n1aIKZ commented 5 years ago

I can reproduce this issue and I found out that it is caused by this lines: https://github.com/OGRECave/ogitor/blob/b4440579c2b15340085cb03f021b5918512fe3fa/Ogitor/include/OgitorsExports.h#L35-L47 OGITOR_EXPORT isn't defined anywhere, so every OgitorExport declaration is replaced with __declspec (dllimport) even when building Ogitor, which is wrong. Either one could just define it using COMPILE_DEFINITIONS or change the DEFINE_SYMBOL which does something similar but defines Ogitor_EXPORTS instead by default.

paroj commented 5 years ago

in ogre I ported most of the modules to https://cmake.org/cmake/help/latest/module/GenerateExportHeader.html

however with ogitor we should aim to get it into a usable state first. Checking for #ifdef Ogitor_EXPORTS is probably the fastest way to get there.

paroj commented 4 years ago

fixed by #16