I checked the installed protobuf distribution in vcpkg's directory and 
indeed it seems that it only supports dynamic libraries...

I would gladly move this discussion to somewhere more related to the vcpkg 
package, but when I search the package on the website 
(https://vcpkg.io/en/packages), it does not show any info at all 
(maintainer, contact, any flags to control static/dynamic builds). Is vcpkg 
completely centralized (because you suggested opening an issue to vcpkg 
itself)?

I do specify the toolchain file in my cmake invocation, in my github build 
pipeline file 
https://github.com/em-eight/ppc2cpp/blob/651231349e7e5745d64f5ef6294fb76704351b07/.github/workflows/windows.yml#L30

At any case, it would be very convenient if protobuf's maintainers added a 
windows binary distribution to the release files. I think a regular static 
build covers 99% of the use cases.
On Thursday, September 28, 2023 at 12:24:14 AM UTC+3 Michael Ngarimu wrote:

> I haven’t looked at all of your specific details but it looks like 
> issue(s) might be how you’re using vcpkg and not related to protobuf. I 
> don’t how list admins feel about whether this is OT or not.
>
> If this discussion needs to move then probably vcpkg github or somewhere 
> might be good to start.
>
> From your description it sounds like vcpkg is building the dynamic library 
> variant of protobuf. I’ve usually used the vcpkg.json manifest for 
> selecting which variant to build. I don’t know if vcpkg uses CMake 
> variables when building the vcpkg port itself.
>
> I do know that vcpkg uses a very specific build environment that the 
> vcpkg.exe executable curates when ports are built so that they are always 
> built in an identical environment, meaning it may not be the same as the 
> environment in your CMake invocation. 
>
> What I don’t see in your CMakefile is the CMAKE_TOOLCHAIN_FILE pointing to 
> your install of vcpkg.cmake. Is that no longer needed?
>
> On Tuesday, September 26, 2023 at 2:39:56 PM UTC-7 Teo Tyrov wrote:
>
>> Hello, I am trying to link my library (ppc2cpp_core.lib) with protobuf, 
>> and then create the executable ppc2cpp.exe. I want link everything 
>> statically, so that downstream users do not require installing protobuf 
>> themselves
>>
>> I am successfully building the library and executable on a github 
>> workflow, but when I try to run it locally, I get "libprotobuf.dll 
>> missing". I've tried using `set(Protobuf_USE_STATIC_LIBS ON)` but it still 
>> doesn't work.
>>
>> My cmake file: 
>> https://github.com/em-eight/ppc2cpp/blob/main/CMakeLists.txt
>>
>> Full workflow logs: 
>> https://github.com/em-eight/ppc2cpp/actions/runs/6318382821/job/17157239443
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/e2a12ccf-c00f-4b18-bcf0-c99d7ac242d1n%40googlegroups.com.

Reply via email to