-
Notifications
You must be signed in to change notification settings - Fork 321
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
C++ : export-attribute not applied to enums #861
Comments
The |
Ah, I understand now. Then I have a feature request:
|
Addition: the generated code is inconsistent anyway when
This is how it appears in
and this is how it appears in the generated
So how is one supposed to use the struct-related functionality together with |
Generating the struct code in a static library is already available. There's an example that demonstrates this. It's written in CMake, so you will need to adapt this to whatever build system you're using. Metadata access is working in the DLL example, so there's probably something slightly different between that example and the UUID project. Could this project be minimized to just the problem so that we can look deeper? |
I want to have both struct code (functions that end up in To get a minimal example, modify the DLL example you referenced as follows:
When the generated code is built as static library, everything works. But I'm using the same code in different executables, and I'd like to both have the option of easily upgrading the schema as well as the advantage of the code being loaded only once in memory (shared across EXEs). |
We were able to reproduce the mismatched DLL export problem with the details you provided. @ara-ayvazyan is working on a fix. |
This has been fixed in commit 101a8f5. If you want to get that fix today, you'll need to build gbc from source. We're working on a release, but the target date is in a few weeks. |
Cool, thanks for the quick fix. |
Free-standing functions
FromString
,ToString
, etc. are generated for enums. When I invoke Bond compiler with--header=\"QS_exports.h\" --export-attribute=QS_API
, this attribute is not applied to these functions, an example from the generated types file:This in turn makes it impossible to use these functions when the generated code is compiled as DLL. Interestingly,
#include "QS_exports.h"
is present in the file.As a workaround, I use functions
GetValueToNameMap
andGetNameToValueMap
, which are defined inline in the header file, but this is.. quite inelegant.The text was updated successfully, but these errors were encountered: