-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export C++ symbols in dynamic Windows libraries #140
Comments
This seems like a fairly non-intrusive change. Are there any side effects of doing this, other than perhaps larger binaries? I don't see how SCons would affect this if the macro goes somewhere like |
Fairly non-intrusive, but tedious, as I believe the decorations need to be applied all over the place (also: I don't expect side effects). The macro should definitely go into I'd be happy to start some tests, but will wait until after 2.6 is released and CTI/XML support etc. is removed. To me personally, this is something I'd like to see in Cantera 3.0 ... |
Fwiw, the definitions above are already included in |
Here's article that I found helpful in covering some of the quirks/limitations of exporting C++ classes in a DLL: https://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL |
Abstract
At the moment, symbols in dynamic libraries are not exported in Windows, i.e.
> dumpbin /exports cantera_shared.dll Microsoft (R) COFF/PE Dumper Version 14.31.31104.0 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file cantera_shared.dll File Type: DLL Summary 1000 .00cfg 19000 .data 5000 .idata 40000 .pdata F9000 .rdata B000 .reloc 5E3000 .text 1000 .tls
does not list any symbols (whereas running
dumpbin /LINKERMEMBER cantera_shared.lib
for the static library lists an extensive list of symbols - at least for the C API?)Motivation
Describe the need for the proposed change:
The ability of accessing Cantera C++ classes and functions at run-time will open additional pathways for the definition of alternative API's and uses in 3rd party applications.
Possible Solutions
Per SO answer, a platform-independent preprocessor macro
will properly export symbols for classes / functions that include the
API
decoration. Note: this is just copy-paste from SO, and thus is untested / may need tweaks. There are likely parts of the SCons build that will have to be adjusted.References
The text was updated successfully, but these errors were encountered: