Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Help with compiling glib

by syphilis (Archbishop)
on Jun 22, 2016 at 11:52 UTC ( [id://1166241]=note: print w/replies, xml ) Need Help??


in reply to Help with compiling glib

These symbols are resolved (for me) by libglib-2.0.a (or libglib-2.0.dll.a).

Your problem is that you specified (in your 'perl Makefile.PL command):
LIBS="-LC:/prog/gtk+/lib"
but that needs to be:
LIBS="-LC:/prog/gtk+/lib -lglib-2.0"
That should fix the undefined references that you've reported, but you might find there are then other undefined references (because I think you might need to link to other import libraries besides -lglib-2.0).

If it's just a matter of installing Gtk2 on Strawberry Perl then the following should work:
UPDATE: Adding --force (which I initially forgot about)
ppm install http://www.sisyphusion.tk/ppm/Cairo.ppd --force ppm install http://www.sisyphusion.tk/ppm/Glib.ppd --force ppm install http://www.sisyphusion.tk/ppm/Pango.ppd --force ppm install http://www.sisyphusion.tk/ppm/Gtk2.ppd --force
And if you then want Gtk2::GladeXML:
ppm install http://www.sisyphusion.tk/ppm/Gtk2-GladeXML.ppd --force
But, of course, if you're actually wanting to build those modules yourself, then the ppm packages don't really help you do that ;-)

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Help with compiling glib
by frazap (Monk) on Jun 22, 2016 at 12:38 UTC
    Hi Rob,

    Thanks for the links. I hoped to get a better understanding (?) in trying to compile this stuff myself... I thought that the copying trick (*.dell.a -> *.a) removed the need to gives the -lxxx in the LIBS parameter. That's not the case obviously.

    And what is the :nosearch added to the beginning of the LIBS parameter doing ? Is it this that can be used in place of the files copy ?

    Best François
      I hoped to get a better understanding (?) in trying to compile this stuff myself...

      Yes, that's the way to learn - though picking something as large as glib is just as likely to lead to "utter confusion" as to "understanding" ;-)
      (At least I sure am glad I didn't try to learn what I know by building glib.)

      I thought that the copying trick (*.dell.a -> *.a) removed the need to gives the -lxxx in the LIBS parameter

      No, no - you always need to give the -lxxx argument. But if you provide the -lxxx argument && the 'perl Makefile.PL' step emits the warning that no library was found for -lxxx && you know that libxxx.dll.a was in the library search path THEN you need to copy libxxx.dll.a to libxxx.a (because your version of ExtUtils::MakeMaker was obviously too stupid to equate -lxxx with libxxx.dll.a but will be quite capable of equating -lxxx with libxxx.a).

      And what is the :nosearch added to the beginning of the LIBS parameter doing ?

      Where in this thread is ":nosearch" mentioned ?
      Ok ... there are already 2 occurrences of the term in this post of mine, and I can see it in your previous post (to which I'm replying) but I can't see it anywhere else and I therefore don't see the relevance of the question.

      I reckon I've seen ":nosearch" in other places, but I don't know what it means and it's not something I've had to bother about in the past. Google can probably provide an explanation.

      Cheers,
      Rob
        :nosearch was used here
        https://project-renard.github.io/doc/development/meeting-log/posts/201 +6/05/03/windows-build-with-msys2/

        "And from the doc: An entry of the form -lfoo specifies the library foo, which may be spelled differently depending on what kind of compiler you are using. If you are using GCC, it gets translated to libfoo.a, but for other win32 compilers, it becomes foo.lib. ... An entry that matches /:nosearch/i disables all searching for the libraries specified after it"

        It was my understanding that :nosearch get the dll.a lib used instead of the .a lib by the linker.

        What am I missing with having undefined reference to `g_value_get_variant' with the code below ?

        Thanks

        François
        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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1166241]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found