Closed Wohlstand closed 6 years ago
Original comment by Michael Pyne (Bitbucket: mpyne, GitHub: mpyne).
Move BLARGG_EXPORT to header.
The supported C++ compilers all prefer the BLARGG_EXPORT decl to be in the declaration instead of the defintion of a symbol (plus this allows the Windows dllimport/dllexport stuff to actually work as intended)
Fixes Issue #24.
Original comment by Michael Pyne (Bitbucket: mpyne, GitHub: mpyne).
I wasn't intending to "Resolve" this issue yet but if you could let me know if this pull request fixes the build on MSVC 2017 I'd appreciate it. If so I'll merge into master.
Original report by jimbo1qaz (Bitbucket: jimbo1qaz, ).
On many functions,
BLARGG_EXPORT
(expands to__declspec(dllexport)
on MSVC2017) is only present in .cpp and not .h. This fails to compile on MSVC 2017.According to https://msdn.microsoft.com/en-us/library/a90k134d.aspx and https://gcc.gnu.org/wiki/Visibility , export statements should present in headers, not .cpp files. Many of the errors I'm getting occur when
BLARGG_EXPORT
is present in .cpp. I'm not sure if it should be in both or not.I also get errors related to
extern const gme_type_t \n gme_ay_type, ...
whereBLARGG_EXPORT
is present in .cpp but not .h.Changing the definition of
BLARGG_EXPORT
to "nothing" fixed the problems for my use case (static linking).