Skip to content

Export C++ API symbols from DLL on Windows - #105

Open
jschueller wants to merge 2 commits into
SarahWeiii:mainfrom
jschueller:export
Open

Export C++ API symbols from DLL on Windows#105
jschueller wants to merge 2 commits into
SarahWeiii:mainfrom
jschueller:export

Conversation

@jschueller

@jschueller jschueller commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

The shared library symbols are not exported on windows.
Use a new COACD_API macro that expands to dllimport / dllexport directives.
CMakeLists has to be modified a bit to build static and shared separately instead of linking one into the other.
Avoids undefined references on windows when linking to the shared library _coacd:

/usr/x86_64-w64-mingw32/bin/ld: CMakeFiles/t_coacd.dir/objects.a(t_coacd.cxx.obj):t_coacd.cxx:(.text.startup+0x251)
: undefined reference to `coacd::CoACD(coacd::Mesh const&, double, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int, int, int, bool, bool, bool, int, bool, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, bool)'
collect2: error: ld returned 1 exit status

@jschueller
jschueller force-pushed the export branch 12 times, most recently from b34730d to ee757da Compare June 19, 2026 20:00
Add COACD_API macro to trigger the dllimport/dllexport visibility macros
@jschueller

Copy link
Copy Markdown
Contributor Author

what do you say @SarahWeiii ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant