Vcpkg: glib:x64-windows-static failing

Created on 2 May 2018  路  13Comments  路  Source: microsoft/vcpkg

actually trying to install cairo x64 static, which previously worked

-- CURRENT_PORT_DIR=C:/Users/oli/Dev/vcpkg/ports/glib/.
Glib relies on DllMain and therefore cannot be built statically
CMake Error at C:/Users/oli/Dev/vcpkg/ports/glib/portfile.cmake:13 (message):
Glib only supports dynamic library and crt linkage

Error: Building package glib:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: glib:x64-windows-static
Vcpkg version: 0.0.110-2018-05-02-1e41c4377f38512d1d6c0d65a2e7b9c7c8b03bea

port-bug

Most helpful comment

Nothing really. I'll look into the build details when I have time and submit a PR for it

All 13 comments

Seems to be due to commits 26fabaf8803cbf4ce36b98c542e2224277e56c98 ("Disable static builds") and 79a526a3753553fd9b1f874ada7688b2fb8396a4

Same issue while trying to install pcl[openni2,qt,pcap]:x64-windows-static --featurepackages

PS C:\Users\USERNAME> vcpkg install pcl[openni2,qt,pcap]:x64-windows-static --featurepackages
The following packages will be built and installed:
  * atlmfc[core]:x64-windows-static
  ...more * packages...
  * openssl[core]:x64-windows-static
    pcl[core,openni2,pcap,qt]:x64-windows-static
  * qhull[core]:x64-windows-static
  ...more * packages...
  * winpcap[core]:x64-windows-static
Additional packages (*) will be modified to complete this operation.
Starting package 1/90: glib:x64-windows-static
Building package glib[core]:x64-windows-static...
-- CURRENT_INSTALLED_DIR=C:/Users/USERNAME/Documents/vcpkg/installed/x64-windows-static
-- DOWNLOADS=C:/Users/USERNAME/Documents/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=C:/Users/USERNAME/Documents/vcpkg/packages/glib_x64-windows-static
-- CURRENT_BUILDTREES_DIR=C:/Users/USERNAME/Documents/vcpkg/buildtrees/glib
-- CURRENT_PORT_DIR=C:/Users/USERNAME/Documents/vcpkg/ports/glib
Glib relies on DllMain and therefore cannot be built statically
CMake Error at ports/glib/portfile.cmake:13 (message):
  Glib only supports dynamic library and crt linkage
Call Stack (most recent call first):
  scripts/ports.cmake:72 (include)


Error: Building package glib:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: glib:x64-windows-static
  Vcpkg version: 0.0.110-2018-05-10-9a19dae13a0fa594245db2df45ec54a504bc82f3

Additionally, attach any relevant sections from the log files above.

Had the same issue trying to use Fluidsynth statically. It says in the comments that Glib requires DLLMain to function so I guess that is the reason.

I'm running into the same issue when trying to build qt5-base. This is kind of a problem, since Qt can be built statically.

Is there any detailed explanations what it is all about? Why so many libraries stuck from being statically build because of some weirdness?
Moreover it is said that "Glib only supports dynamic library and crt linkage" ... I do not see direct connection between crt linkage and using of DllMain

This is a real pain point. Anybody with more information?

Nothing really. I'll look into the build details when I have time and submit a PR for it

The symbols: GLIB_STATIC_COMPILATION and GOBJECT_STATIC_COMPILATION seem to allow this?
https://github.com/GNOME/glib/blob/4e1488eebb2129c6e39162b56275d311f24216ab/meson.build#L175-L178

any news from anyone? i have tried and failed to fix this

I have tried but entered an endless rabbit hole, too many dependencies. Also gave up because other builds broke randomly.

On 22 October 2018 22:09:35 CEST, Oli Larkin notifications@github.com wrote:

any news from anyone? i have tried and failed to fix this

--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/Microsoft/vcpkg/issues/3409#issuecomment-431964130

it definitely worked in the past

GLib doesn't support static build for Windows. See more information here:
https://bugzilla.gnome.org/show_bug.cgi?id=752837
https://github.com/microsoft/vcpkg/pull/529#issuecomment-272586906

Should it fail the build though? I've seen other times it will force dynamic linking instead and continue. For instance, if you want to build a static version of fluidsynth i.e. fluidsynth:x64-windows-static. Glib is a dependency so it will try to build statically but fail due to the error above. Should it not continue but use it dynamically and the rest statically? Otherwise you need to create a custom triplet, which is a bit of a pain.

@stekyne To build glib as a static library and link using a static CRT, we will get a Dllmain error:

gobject-2.0.lib(gtype.c.obj) : error LNK2005: DllMain already defined in glib-2.0.lib(glib-init.c.obj)

So we need to solve this first.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madkoala picture madkoala  路  3Comments

jasjuang picture jasjuang  路  3Comments

jack17529 picture jack17529  路  3Comments

tzbo picture tzbo  路  3Comments

grandprixgp picture grandprixgp  路  3Comments