in reply to Re^4: Help with compiling glib
in thread Help with compiling glib

I'm sorry, but I can't help you here. Your Makefile seems to be some "special" kind of Makefile which doesn't output the verbatim command lines it runs but something like

[ CC GVariant.c ]

... which does not help anybody. I don't know what is responsible for this output but if you find out who/what causes that, remove that cause and burn it with fire.

Update

There it is, in lib/Glib/MakeHelper.pm:

# # And, some black magick to help make learn to shut the hell up. # sub quiet_rule { my $cmds = shift; my @lines = split /\n/, $cmds; foreach (@lines) { if (/NOECHO/) { # already quiet } elsif (/XSUBPP/) { s/^\t/\t\$(NOECHO) \$(ECHO) [ XS \$< ]\n\t\$(NOECHO) /; } elsif (/CCCMD/) { s/^\t/\t\$(NOECHO) \$(ECHO) [ CC \$< ]\n\t\$(NOECHO) /; } elsif (/\bLD\b/) { s/^\t/\t\$(NOECHO) \$(ECHO) [ LD \$@ ]\n\t\$(NOECHO) /; } elsif (/[_\b]AR\b/) { s/^\t/\t\$(NOECHO) \$(ECHO) [ AR \$@ ]\n\t\$(NOECHO) /; } } return join "\n", @lines; }

Instead of this "beautiful" yet incredibly unhelpful idiocy, remove all this commenting and all instances of $(NOECHO) and reduce that subroutine to a no-op:

sub quiet_rule { my $cmds = shift; return $cmds; }

The people who want "beautiful" or "quiet" output from make don't really understand why the output from make is there. It's not there for the case where everything goes according to plan but for the case where the build fails.

Replies are listed 'Best First'.
Re^6: Help with compiling glib
by frazap (Monk) on Jun 22, 2016 at 12:07 UTC
    Changing the sub as you described and running the same set of commands gives:
    gcc -c -IC:\prog\gtk+\include\glib-2.0 -IC:\prog\Gtk+\lib\glib-2.0\in +clude -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONT +EXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields - +s -O2 -DVERSION=\"1.321\" -DXS_VERSION=\"1.321\" -o gperl-g +types.o "-IC:\STRAWB~1\perl\lib\CORE" gperl-gtypes.c "C:\strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Glib\", 'DLBASE' => 'Glib', 'DL_FUNCS' = +> { Glib=>[] }, 'FUNCLIST' => [q[SvGChar], q[SvGKeyFile], q[SvGParamF +lags], q[SvGParamSpec], q[SvGSignalFlags], q[SvGInt64], q[SvGUInt64], + q[SvGVariant], q[SvGVariantType], q[_gperl_attach_mg], q[_gperl_call +_XS], q[_gperl_find_mg], q[_gperl_remove_mg], q[gperl_alloc_temp], q[ +gperl_argv_free], q[gperl_argv_new], q[gperl_argv_update], q[gperl_bo +xed_package_from_type], q[gperl_boxed_type_from_package], q[gperl_cal +lback_destroy], q[gperl_callback_invoke], q[gperl_callback_new], q[gp +erl_closure_new], q[gperl_closure_new_with_marshaller], q[gperl_conve +rt_back_enum], q[gperl_convert_back_enum_pass_unknown], q[gperl_conve +rt_back_flags], q[gperl_convert_enum], q[gperl_convert_flag_one], q[g +perl_convert_flags], q[gperl_croak_gerror], q[gperl_default_boxed_wra +pper_class], q[gperl_filename_from_sv], q[gperl_format_variable_for_o +utput], q[gperl_fundamental_package_from_type], q[gperl_fundamental_t +ype_from_package], q[gperl_gerror_from_sv], q[gperl_get_boxed_check], + q[gperl_get_object], q[gperl_get_object_check], q[gperl_handle_logs_ +for], q[gperl_hv_take_sv], q[gperl_install_exception_handler], q[gper +l_new_boxed], q[gperl_new_boxed_copy], q[gperl_new_object], q[gperl_o +bject_check_type], q[gperl_object_package_from_type], q[gperl_object_ +set_no_warn_unreg_subclass], q[gperl_object_stash_from_type], q[gperl +_object_type_from_package], q[gperl_option_context_get_type], q[gperl +_option_group_get_type], q[gperl_package_from_type], q[gperl_param_sp +ec_package_from_type], q[gperl_param_spec_type_from_package], q[gperl +_prepend_isa], q[gperl_register_boxed], q[gperl_register_boxed_alias] +, q[gperl_register_boxed_synonym], q[gperl_register_error_domain], q[ +gperl_register_fundamental], q[gperl_register_fundamental_alias], q[g +perl_register_object], q[gperl_register_object_alias], q[gperl_regist +er_param_spec], q[gperl_register_sink_func], q[gperl_remove_exception +_handler], q[gperl_run_exception_handlers], q[gperl_set_isa], q[gperl +_signal_connect], q[gperl_signal_set_marshaller_for], q[gperl_str_eq] +, q[gperl_str_hash], q[gperl_sv_copy], q[gperl_sv_is_defined], q[gper +l_sv_free], q[gperl_sv_from_filename], q[gperl_sv_from_gerror], q[gpe +rl_sv_from_value], q[gperl_sv_get_type], q[gperl_try_convert_enum], q +[gperl_try_convert_flag], q[gperl_type_class], q[gperl_type_from_pack +age], q[gperl_value_from_sv], q[newSVGChar], q[newSVGParamFlags], q[n +ewSVGParamSpec], q[newSVGSignalFlags], q[newSVGSignalInvocationHint], + q[newSVGSignalQuery], q[newSVGInt64], q[newSVGUInt64], q[newSVGVaria +nt], q[newSVGVariant_noinc], q[newSVGVariantType], q[newSVGVariantTyp +e_own]], 'IMPORTS' => { }, 'DL_VARS' => []);" g++ Glib.def -o blib\arch\auto\Glib\Glib.xs.dll -mdll -s -L"C:\STRAWB~ +1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" Glib.o GError.o GUtils.o GLog. +o GType.o GBoxed.o GObject.o GValue.o GClosure.o GSignal.o GMainLoop. +o GIOChannel.o GParamSpec.o GKeyFile.o GOption.o GBookmarkFile.o GVar +iant.o gperl-gtypes.o "C:\STRAWB~1\perl\lib\CORE\libperl524.a" "C:\ +STRAWB~1\c\i686-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\i686-w6 +4-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libu +ser32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1 +\c\i686-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\i686-w64-mingw3 +2\lib\libcomdlg32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libadvapi32. +a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\i +686-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\l +iboleaut32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libnetapi32.a" "C:\ +STRAWB~1\c\i686-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\i686-w64-mi +ngw32\lib\libws2_32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libmpr.a" +"C:\STRAWB~1\c\i686-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\i686-w +64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libo +dbc32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libodbccp32.a" "C:\STRAW +B~1\c\i686-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-bas +e Glib.o:Glib.c:(.text+0x85): undefined reference to `g_filename_display +_basename' Glib.o:Glib.c:(.text+0xb6): undefined reference to `g_free' Glib.o:Glib.c:(.text+0x195): undefined reference to `g_filename_displa +y_name' Glib.o:Glib.c:(.text+0x1c6): undefined reference to `g_free' Glib.o:Glib.c:(.text+0x2e3): undefined reference to `g_filename_from_u +ri_utf8' Glib.o:Glib.c:(.text+0x391): undefined reference to `g_free'

      As syphilis already spotted in Re: Help with compiling glib, you're not linking glib-2.0 due to the conflation of search directories and library instructions in the LIBS parameter. Adding -lglib-2.0 to the LIBS= invocation should fix that (as suggested by syphilis.

        my call to makefile.pl is now
        perl Makefile.pl INC="-IC:\prog\gtk+\include\glib-2.0 -IC:\prog\Gtk+\l +ib\glib-2.0\include" LIBS="-LC:/prog/gtk+/lib -lglib-2.0 -lintl -lgob +ject-2.0 -lgthread-2.0"
        But I still have undefined refs errors (GVariant.o:GVariant.c undefined reference to g_value_get_variant')
        g++ Glib.def -o blib\arch\auto\Glib\Glib.xs.dll -mdll -s -L"C:\STRAWB~ +1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" Glib.o GError.o GUtils.o GLog. +o GType.o GBoxed.o GObject.o GValue.o GClosure.o GSignal.o GMainLoop. +o GIOChannel.o GParamSpec.o GKeyFile.o GOption.o GBookmarkFile.o GVar +iant.o gperl-gtypes.o "C:\STRAWB~1\perl\lib\CORE\libperl524.a" "C:\ +prog\gtk+\lib\libglib-2.0.a" "C:\prog\gtk+\lib\libintl.a" "C:\prog\gt +k+\lib\libgobject-2.0.a" "C:\prog\gtk+\lib\libgthread-2.0.a" "C:\STRA +WB~1\c\i686-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\i686-w64-mi +ngw32\lib\libkernel32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libuser3 +2.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\i +686-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\i686-w64-mingw32\li +b\libcomdlg32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libadvapi32.a" " +C:\STRAWB~1\c\i686-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\i686- +w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libol +eaut32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libnetapi32.a" "C:\STRA +WB~1\c\i686-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\i686-w64-mingw3 +2\lib\libws2_32.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libmpr.a" "C:\ +STRAWB~1\c\i686-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\i686-w64-m +ingw32\lib\libversion.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libodbc3 +2.a" "C:\STRAWB~1\c\i686-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\ +c\i686-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-base GVariant.o:GVariant.c:(.text+0x1db): undefined reference to `g_value_g +et_variant' GVariant.o:GVariant.c:(.text+0x4274): undefined reference to `g_varian +t_lookup_value' GVariant.o:GVariant.c:(.text+0x1be): undefined reference to `g_value_s +et_variant'

        Given a bunch of undefined refs errors how can I spot the missing libraries ?