protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

BUG: pkg-config metadata is incorrect on windows

Open h-vetinari opened this issue 10 months ago • 3 comments

What version of protobuf and what language are you using? Version: v29.1 (but problem remains on main) Language: C++

What operating system (Linux, Windows, ...) and version?

windows

What runtime / compiler are you using (e.g., python version or gcc version)

VS2019

What did you do?

Build protobuf, try to use pkg-config metadata in dependent project

What did you expect to see

Build succeeds

What did you see instead?

LINK : fatal error LNK1181: cannot open input file 'upb.lib'

This is because the windows builds here have a non-default prefix (e.g. libprotobuf.lib instead of protobuf.lib), and so the linker invocation here

https://github.com/protocolbuffers/protobuf/blob/796e49f6ca82f763d1087d2ff7355d2f0d7b71b1/cmake/upb.pc.cmake#L9

is actually looking for the wrong library (upb.lib instead of the libupb.lib that gets installed). Since %INSTALL_PREFIX%\lib\pkgconfig\upb.pc gets installed by default, it should be correct.

Anything else we should know about your project / environment

The error does not appear with CMake, but there's several more pkg-config files that have the same problem AFAICT.

h-vetinari avatar Feb 28 '25 08:02 h-vetinari

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 inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Sep 07 '25 10:09 github-actions[bot]

Not stale

h-vetinari avatar Sep 08 '25 14:09 h-vetinari

We will accept a contribution.

PilgrimMemoirs avatar Dec 02 '25 18:12 PilgrimMemoirs