simongeilfus / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
4 stars 1 forks source link

msw_dll notes #4

Open simongeilfus opened 7 years ago

simongeilfus commented 7 years ago

Issues:

-operator<<: Can't seem to find how to export those without duplicate symbols (fixed in https://github.com/simongeilfus/Cinder/commit/4e5894e140259dfbc64b7e2e0549dddca748ec99) -Should header only functions be tagged with CI_API? ex: Easing.h (It seems fine for Easing.h functions and structs) -GeomIo.h: Rect:: static sNormals, sTangents -> geom::Rect not exported! (fixed in https://github.com/simongeilfus/Cinder/commit/5300aa2793462b2a1813bcff5a7a580f8bf2a406) -Svg.h: svg::Style: same as geom::Rect: static / a member of a class declared with dllexport/dllimport cannot itself be declared with such a specifier (fixed in https://github.com/simongeilfus/Cinder/commit/a3d13a3ff7f7ef5b3d42ae83a85eab529354f1e4) -Fbo.h: same as geom::Rect: static / a member of a class declared with dllexport/dllimport cannot itself be declared with such a specifier (potential fix here: https://github.com/simongeilfus/Cinder/commit/7bcafe7989cd9a321b0fda5723727175583eec94)

Notes:

-signals.h: added #include "cinder/Cinder.h" (changed to "CinderExports.h" in https://github.com/simongeilfus/Cinder/commit/1e5fd68e72e6dcc023d2edfe2c70f8e2e5654aba) -Exception.h: added #include "cinder/Cinder.h" (changed to "CinderExports.h" in https://github.com/simongeilfus/Cinder/commit/1e5fd68e72e6dcc023d2edfe2c70f8e2e5654aba) -BandedMatrix.h: added #include "cinder/Cinder.h" (changed to "CinderExports.h" in https://github.com/simongeilfus/Cinder/commit/1e5fd68e72e6dcc023d2edfe2c70f8e2e5654aba) -CinderAssert.h: added #include "cinder/Cinder.h" (changed to "CinderExports.h" in https://github.com/simongeilfus/Cinder/commit/1e5fd68e72e6dcc023d2edfe2c70f8e2e5654aba) -CinderAssert.h: User handlers are not exported. Not tested! WRONG [-Using glload.lib and glloadd.lib in both cinder and the host app is the only way I found to use raw opengl without running into missing symbols issues] (removed in https://github.com/simongeilfus/Cinder/commit/e0e270a29972a910b2568ed185a4bd4cbfc571d0)

Todo:

-cinder/audio: not exported yet -cinder/app/AppScreenSaver: not exported yet -cinder/qtime: not exported yet -cinder/ImageSourcePng: not exported yet

simongeilfus commented 7 years ago

Adding dll targets to existing project:

  1. Create new configuration for Debug_DLL and Release_DLL (use "copy setting from" in the configuration manager)
  2. Project Properties / C++ / Code Generation: change Runtime Library to /MDd and /MD
  3. Project Properties / Build Events / Post-Build Event / Command Line: xcopy /y /d "..\..\..\lib\msw\$(PlatformTarget)\$(Configuration)\$(PlatformToolset)\cinder.dll" "$(OutDir)" (change the first path to be relative to the project)
  4. Add CINDER_DLL to the Preprocessor Definitions
  5. Project Properties / Linker / Input / Additional Dependencies: Add glload.lib and glloadD.lib