-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
grpc fails to build on x64-windows #535
Comments
The same thing happens with the newest commit, def69b30756c9fb043f9b807b5c4156f6859c80c. |
The latest 1.0.x branch (commit e05c76591acc488a5c52af25786aadd659b298f7) has an error during CMake config step:
|
Probably related to #226 |
Yes, it looks like the same error. I will try to see if it can be fixed by a minor change to |
Trying to use this trick by adding Did this library (grpc) ever compile through vcpkg? If not, it should be removed from the list in the vcblog article. |
We tried the same thing and reached the same conclusion: it is not going to work for quite some time into the future (until grpc people fix their CMake build system). |
I wonder why portfile says static building not supported. With a little patch that properly links zlib it should work fine, while shared ones seem problematic. |
Because of protobuf #149 |
When they introduced the ability to make static builds in vcpkg, they added that condition which forces dynamic build for all libraries. Yes, it could be possible to try static build. grpc authors force static building on Windows in their own Visual Studio solutions. |
@codicodi will you give static version a try? |
Well, changing dynamic override to static override seems to work (ie. it builds). But it still fails post-build checks (probably the portfile messes something up during cleanup). |
Fails which post-build checks? Can you provide a log fragment and/or diff to portfile? |
It looks like portfile removes all the debug libs. I'll prepare PR with fix... |
Merged #539. Also, I noticed
4ace533 is an attempt to make the build more consistent. |
Thanks @alexkaratarakis! #539 fixes the build issue. However, when I try to build my project which depends on gRPC, I get link errors to its dependencies (zlib and OpenSSL):
And the probable reason for not having protobuf link errors is that our project directly depends on protobuf too (in addition to gRPC). I will try building static versions of zlib and OpenSSL and see whether that helps. |
Building ("installing") static version of grpc and its dependencies does not resolve the linking problem. Explicitly adding zlib and openssl as linker inputs enables our project to build and run. Is this the expected behavior? |
That's definitely not the expected behavior; linking zlib and openssl should have been done automatically for you. Are you using the user wide integration or the NuGet package based integration? In the case of the NuGet package, did you add the same package to each of your projects? Edit: Additionally, do you have "inherit from project defaults" checked? Unchecking that box will suppress our automatic linkage. |
I was relying on user-wide integration. I did not try NuGet packages. The reason I am trying vcpkg is because with a CMake-based project, I have to manually uninstall and then install NuGet packages each time VS solution is regenerated by CMake (which happens frequently as this project is under development). Edit: I did not fiddle with "inherit from project defaults", I think it was on (as usual). |
Ah, then that is the issue -- sorry, I jumped to the conclusion above that you were using just MSBuild. We attempt to be a good CMake citizen by following the CMake paradigm of
|
That works with static build. Thanks @ras0219-msft !
|
Root cause: project
grpc_plugin_support
is built only as .dll, not as .lib, other projects which depend on it cannot find .lib which causes link error.Excerpts from
package-x64-windows-rel-out.log
:The text was updated successfully, but these errors were encountered: