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
Failed to build on Windows: definition of dllimport function not allowed #7567
Comments
FYI 3.11.4 is working. |
After add
|
same problem. how to solve? |
I can confirm that neither versions v3.12.2 nor v3.12.3 work with vc142 + "NMake Makefiles", but v3.11.4 does work. I get the same errors compiling the
|
This can be solved by not exporting the method definitions for Here is a patch: Index: src/google/protobuf/parse_context.h
===================================================================
--- src/google/protobuf/parse_context.h
+++ src/google/protobuf/parse_context.h
@@ -744,7 +744,7 @@
void* object, const char* ptr, ParseContext* ctx);
template <typename T>
-PROTOBUF_EXPORT_TEMPLATE_DEFINE
+// PROTOBUF_EXPORT_TEMPLATE_DEFINE do not export definition
PROTOBUF_MUST_USE_RESULT const
char* PackedEnumParser(void* object, const char* ptr, ParseContext* ctx,
bool (*is_valid)(int), InternalMetadata* metadata,
@@ -760,7 +760,7 @@
}
template <typename T>
-PROTOBUF_EXPORT_TEMPLATE_DEFINE
+// PROTOBUF_EXPORT_TEMPLATE_DEFINE do not export definition
PROTOBUF_MUST_USE_RESULT const
char* PackedEnumParserArg(void* object, const char* ptr, ParseContext* ctx,
bool (*is_valid)(const void*, int), Tested on all these platforms:
|
- protocolbuffers/protobuf#7567 gRPC 1.30 requires Protobuf 3.12 implicitly, lifting the bar to make both of them work.
@jjELT Also can someone help clarify if this is fixed silently? |
OK things start to get more strange. |
Looks like friends from conda double confirm the issue: |
This might be the reason for non-monotonicity |
@xkszltl: I checked again. None of the versions 3.12.2, 3.12.3 nor 3.12.4 work for me out of the box. Only after manually applying @eldruin's fix mentioned above it works (tested only with v3.12.4).
|
3.13.0 seems working. Can anyone confirm? |
We were able to skip applying the patch in 3.13.0 ( conda-forge/libprotobuf-feedstock#67 ). Would be great if there was some kind of test introduced for this issue. |
I also run into this problem while packaging 3.12.4 for Conan |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment. This issue is labeled |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it. This issue was closed and archived because there has been no new activity in the 14 days since the |
What version of protobuf and what language are you using?
Version: v3.12.2 (latest release tag)
Language: C++
What operating system (Linux, Windows, ...) and version?
Win
What runtime / compiler are you using (e.g., python version or gcc version)
VS2019
What did you do?
CMake+Ninja.
Build script:
https://github.com/xkszltl/Roaster/blob/a66b24f36fb91d1aeeb62628e8ae5b0b61468f6f/win/pkgs/protobuf.ps1#L29-L57
What did you see instead?
This should be a recent regression.
The text was updated successfully, but these errors were encountered: