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/962f5eea-3842-42ea-b9f5-30d55f67dfeen%40googlegroups.com.

Reply via email to