Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] Glib libgpod mac os x Compile error
QtWS25 Last Chance

[solved] Glib libgpod mac os x Compile error

Scheduled Pinned Locked Moved General and Desktop
27 Posts 2 Posters 13.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KioR
    wrote on last edited by
    #1

    I am trying to include libgpod in my application so I can communicate with Ipods. I have compiled and installed libgpod-0.8.0 , then I got error that it requires Glib.

    I installed Glib using brew install glib. However now when I try and compile it throws up error:

    /usr/local/Cellar/glib/2.38.2/include/glib-2.0/glib/gtypes.h:34: error: 'glibconfig.h' file not found
    #include <glibconfig.h>

    Only thing I could find was that i need to include pkg-config --cflags glib-2.0 when compiling . Not sure how to do this though or if that is the problem?

    In my pro file I have added :

    @INCLUDEPATH += /usr/local/include/gpod-1.0/gpod
    INCLUDEPATH += pkg-config --cflags glib-2.0
    INCLUDEPATH += /usr/local/Cellar/glib/2.38.2/include/glib-2.0

    LIBS += /usr/local/Cellar/glib/2.38.2/lib/libglib-2.0.dylib
    LIBS += pkg-config --libs glib-2.0
    @

    my code in mainwindow is :

    @Itdb_iTunesDB *db;@

    I am running mac os x 10.9.1 and Qt Creator 2.8.1
    Based on Qt 5.1.1 (Clang 3.1, 64 bit)

    I have also tried comiling glib from source without homebrew , but same issue. It has been 3 days now I have been searching for a solution and cannot find anything on it.

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You're not using pkg-config correctly with qmake
      Try this
      @
      CONFIG += link_pkgconfig
      PKGCONFIG += glib-2.0
      @

      Just to be sure, do you have pkg-config installed ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KioR
        wrote on last edited by
        #3

        Just tried adding the above into my .pro file and now get the follwing error:

        :-1: error: Package glib-2.0 not found

        Yes pkg-config is already installed using hombrew.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          then run

          @pkg-config --list-all | grep glib@

          To see whether it knows about any glib installed

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • K Offline
            K Offline
            KioR
            wrote on last edited by
            #5

            from terminal I have ran pkg-config --listall which has glib-2.0 , so seems like qt is not seeing pkg-config?

            1 Reply Last reply
            0
            • K Offline
              K Offline
              KioR
              wrote on last edited by
              #6

              Output of pkg-config --list-all | grep glib:

              gio-unix-2.0 GIO unix specific APIs - unix specific headers for glib I/O library
              taglib_c TagLib C Bindings - Audio meta-data library (C bindings)
              gio-2.0 GIO - glib I/O library
              glib-2.0 GLib - C Utility Library
              taglib TagLib - Audio meta-data library

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                So it's likely a path problem. What you can do is close Qt Creator, and call

                @open your_project.pro@

                from the command line, that should start Qt Creator with the additional paths setup you might have for your command line. If it doesn't work, remove the your_project.pro.user file after having closed Qt Creator, and call open again

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  KioR
                  wrote on last edited by
                  #8

                  Still the same issue. It cannot even parse the .pro file now. Below is my .pro file:

                  @QT += core gui

                  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                  TARGET = tesrre
                  TEMPLATE = app

                  SOURCES += main.cpp
                  mainwindow.cpp

                  HEADERS += mainwindow.h

                  FORMS += mainwindow.ui

                  CONFIG += link_pkgconfig
                  PKGCONFIG += glib-2.0

                  INCLUDEPATH += /usr/local/include/gpod-1.0/gpod
                  INCLUDEPATH += /usr/local/Cellar/glib/2.38.2/include/glib-2.0

                  LIBS += /usr/local/Cellar/glib/2.38.2/lib/libglib-2.0.dylib
                  LIBS +=/usr/local/lib/libgpod.4.dylib@

                  Tired adding PKG_CONFIG_PATH+=/usr/local/Cellar/pkg-config/0.28/bin
                  into qmake additional arguments, and also added a new variable under system environment but did not change anything.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    What do you mean by "It cannot even parse the pro file" ?
                    glib-2.0 should be handled by pkg-config so no need for any other setup.

                    @LIBS += -L /usr/local/lib -lgpod@

                    Is more likely for gpod

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      KioR
                      wrote on last edited by
                      #10

                      I mean that I cannot click the green build and run icon, as it says it cannot parse .pro file.

                      gpod was fine before the way i had added it and if i comment out :

                      @CONFIG += link_pkgconfig
                      PKGCONFIG += glib-2.0@

                      then it parses fine. But I have commented out the gpod bit for now just to make sure, and still the same.

                      All I have added to the .pro file now is:

                      @CONFIG += link_pkgconfig
                      PKGCONFIG += glib-2.0@

                      If I open in qt creator 3. then it still has the parse issue , but says:

                      Project ERROR: Package glib-2.0 not found

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Do you have several Qt Creator installed ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          KioR
                          wrote on last edited by
                          #12

                          Yeah I suppose. I have Qt5.1.1
                          Qt5.2.0 folders both in my user folder. Not sure why I have two, Should I try and remove one?

                          Qt5.1.1 has Qt creator 2.8

                          Qt5.2.0 has Qt creator 3.0.0

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Then you have your Qt 5.1.1 Qt Creator starting and this one can't handle 5.2.

                            Try calling open with -b /Path/to/Your/5.2/Qt Creator.app

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              KioR
                              wrote on last edited by
                              #14

                              I tried

                              open tesrre.pro -b /Users/tom/Qt5.2.0/QtCreator.app

                              And get:

                              LSGetApplicationForInfo() failed with error -10814 while trying to determine the application with bundle identifier /Users/tom/Qt5.2.0/QtCreator.app.

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                Sorry, my bad, it's -a

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  KioR
                                  wrote on last edited by
                                  #16

                                  I have uninstalled all versions of Qt , and reinstalled from the latest 5.2.1

                                  Created a new application and tried again. Now it is asking me for glib2-development package.

                                  Cannot find this on homebrew and no where to compile from source. So have just installed Macports and now installed glib2-devel. seems like it just installed the same files that were already present with the homebrew port, with some documentation.

                                  Still not working and error saying:

                                  Project ERROR: glib-2.0 development package not found

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    You might need to add /opt/local/lib/pkgconfig to your PKG_CONFIG_PATH

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • K Offline
                                      K Offline
                                      KioR
                                      wrote on last edited by
                                      #18

                                      I think the PKG_CONFIG_PATH is fine as it is now seeing glib-2.0 , but is now asking for development package.

                                      After installing with macports doing pkg config --list-all shows the same as before , so think the development package has not installed.
                                      Not really sure what I am supposed to see after installing it.
                                      Do you know a better way of installing?

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #19

                                        Do you have something like

                                        @export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH@

                                        in your .profile file ?

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • K Offline
                                          K Offline
                                          KioR
                                          wrote on last edited by
                                          #20

                                          Yeah just added something similar to my .profile . It contains the following:

                                          export PATH=/usr/local/bin:$PATH
                                          export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

                                          Still the same. Tried launching from terminal again.

                                          Funny, I have tried on a ubuntu install and it just works. Was amazed at how easy it was.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved