Skip to content

How to use static and dynamic libraries at the same time? #33256

Answered by YuHuanTin
YuHuanTin asked this question in Q&A
Discussion options

You must be logged in to vote

I seem to have figured out how to do it

  • I need to create a folder with any name (triplets-custom for example) and put in x86-windows-boost-locale-static.cmake
    with the following contents

    set(VCPKG_TARGET_ARCHITECTURE x86)
    set(VCPKG_CRT_LINKAGE dynamic)
    set(VCPKG_LIBRARY_LINKAGE dynamic)
    
    if (${PORT} MATCHES "boost-locale")
        set(VCPKG_LIBRARY_LINKAGE static)
    endif ()
    
  • Then you need to use
    vcpkg install boost-locale:x86-windows-boost-locale-static --overlay-triplets=triplets-custom
    vcpkg install openssl:x86-windows-boost-locale-static --overlay-triplets=triplets-custom
    command builds the libraries (where openssl is a dynamic library and boost-locale is built as a static library).

  • F…

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
4 replies
@YuHuanTin
Comment options

@YuHuanTin
Comment options

Answer selected by YuHuanTin
@Neumann-A
Comment options

@YuHuanTin
Comment options

Comment options

You must be logged in to vote
3 replies
@YuHuanTin
Comment options

@davidhunter22
Comment options

@YuHuanTin
Comment options

Comment options

You must be logged in to vote
4 replies
@YuHuanTin
Comment options

@RelicOfTesla
Comment options

@dg0yt
Comment options

@YuHuanTin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants