microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.27k stars 6.42k forks source link

wxWidgets package does not copy dlls to build folder #16182

Open SergioMasson opened 3 years ago

SergioMasson commented 3 years ago

Describe the bug When using vcpkg with cmake and wxWidgets all dlls required by the application are not copied to the build directory. This makes the aplication fail to start.

Environment

unixwitch commented 3 years ago

i'm seeing this as well, or something related.

for Release build, everything is fine:

PS Y:\source\yarrow\master> dumpbin /imports .\_build\x64-windows-release\src\cmd\yarrow-licgen-ui\yarrow-licgen-ui.exe | sls 'wx.*\.dll'

    wxmsw314u_core_vc_custom.dll
    wxbase314u_vc_custom.dll

PS Y:\source\yarrow\master> dir _build\x64-windows-release\src\cmd\yarrow-licgen-ui\wx*.dll

    Directory: Y:\source\yarrow\master\_build\x64-windows-release\src\cmd\yarrow-licgen-ui

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          13/02/2021    09:35        2618880 wxbase314u_vc_custom.dll
-a---          13/02/2021    09:36        7002112 wxmsw314u_core_vc_custom.dll

but for Debug, nothing is copied:

PS Y:\source\yarrow\master> dumpbin /imports .\_build\x64-windows-debug\src\cmd\yarrow-licgen-ui\yarrow-licgen-ui.exe | sls 'wx.*\.dll'

    wxmsw314u_core_vc_custom.dll
    wxbase314u_vc_custom.dll
    wxmsw314u_xrc_vc_custom.dll

PS Y:\source\yarrow\master> dir _build\x64-windows-debug\src\cmd\yarrow-licgen-ui\wx*.dll
PS Y:\source\yarrow\master>

and the application doesn't work.

JackBoosY commented 3 years ago

I think you need to use feature VCPKG_APPINSTALL_DEPS, see https://github.com/microsoft/vcpkg/pull/13011.

JackBoosY commented 3 years ago

Please see https://github.com/microsoft/vcpkg/pull/16723.

mulderp commented 3 years ago

i am runniing into a similar problem. wx base and custom dll is not found, when i copy those manually i get libpng jpeg tiiff dll not found

what would be the suitable approach to get a clean build?

JackBoosY commented 3 years ago

You should use the executable in _VCPKGROOT/installed/TRIPLET/tools/wxwidgets instead.

mulderp commented 3 years ago

thanks, I see the dlls there, but I still get problems: The procedure entry point inflateValidate could not be located in the dynamic link library --> libpng16.dll 1) how to further debug this dependency problem? 2) Alternatively, maybe it would become easier to link the wxWidgets dlls statically? how can I try that?

JackBoosY commented 3 years ago

@mulderp Can you please confirm zlib1.dll exists in _VCPKGROOT/installed/TRIPLET/tools/wxwidgets? I can successfully run wxrc.exe on my machine locally.

mulderp commented 3 years ago

thanks a lot. yes, after I found wxrc.exe and got it running, it was not too difficult to get my actual project running too. Interesting there is such a thing as the /tools folder (I was mainly looking into the /bin folder before)

On Tue, Jun 22, 2021 at 4:44 AM Jack·Boos·Yu @.***> wrote:

@mulderp https://github.com/mulderp Can you please confirm zlib1.dll exists in VCPKG_ROOT/installed/TRIPLET/tools/wxwidgets? I can successfully run wxrc.exe on my machine locally.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/16182#issuecomment-865484715, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABV3EFPASSPH5I62QQE3YTTT72JJANCNFSM4XPIWVVQ .

JackBoosY commented 3 years ago

@mulderp On Windows, the bin folder should only contains the dynamic libraries and pdbs, the lib folder should only contains static libraries and pkgconfigs, the tools folder should only contains executable related files, and the share folder should contains cmake configuration files, copyright, docs, examples and etc.