Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How to add png++/libpng to Qt Creator?

    Tools
    3
    7
    5853
    Loading More Posts
    • 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
      kwyjibo last edited by

      I will change the code to use QImage but first I need to run it as is (with png++)

      If this can't be done on Qt Creator any other free compiler with Qt support would be good, thanks.

      Using windows Qt Creator 2.4.1

      I already tried different version of libng and png++

      I added this to my .pro file so it loads libraries
      @LIBS += -L"$$PWD/lpng159/" -lpsapi
      LIBS += -L"$$PWD/png++/" -lpsapi@

      but when compiling I get errors like these:
      @build-desktop-Qt_4_8_0_for_Desktop_-MinGW__Qt_SDK__Debug/../xx/png++/info_base.hpp:55: undefined reference to png_create_info_struct' debug/main.o:build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug/../xx/png++/info.hpp:60: undefined reference to png_read_info'
      debug/main.o:build-desktop-Qt_4_8_0_for_Desktop
      -MinGW__Qt_SDK__Debug/../xx/png++/info.hpp:69: undefined reference to png_get_IHDR' debug/main.o:build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug/../xx/png++/info.hpp:71: undefined reference to png_get_valid'
      debug/main.o:build-desktop-Qt_4_8_0_for_Desktop
      -MinGW__Qt_SDK__Debug/../xx/png++/info.hpp:75: undefined reference to png_get_PLTE' debug/main.o:build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug/../xx/png++/info.hpp:79: undefined reference to png_get_valid'
      debug/main.o:build-desktop-Qt_4_8_0_for_Desktop
      -_MinGW__Qt_SDK__Debug/../xx/png++/info.hpp:85: undefined reference to `png_get_tRNS'@

      1 Reply Last reply Reply Quote 0
      • K
        koahnig last edited by

        welcome to devnet

        Are you sure that there is info_base.hpp and info.hpp in the directory png++ ?

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply Reply Quote 0
        • K
          kwyjibo last edited by

          Thank you :)
          yes the file are there I extracted png++ again to test, still same problem.

          1 Reply Last reply Reply Quote 0
          • K
            koahnig last edited by

            Do you have "includepath":http://developer.qt.nokia.com/doc/qt-4.8/qmake-variable-reference.html#includepath set?

            But probably there is a problem with your relative path you are using. Is there a directory "xx" parallel to "build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug"?

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply Reply Quote 0
            • K
              kwyjibo last edited by

              Ye, sorry I just hate to show real paths online, specially when they are absolute.

              My project path is Qt\untitled, the "debug" path is located on Qt\untitled-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug

              I didn't change anything on default project, just added the 2 lines mentioned above to my project file.

              Here is roughly my folder structure
              @Qt
              untitled-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug\ <-auto generated
              <auto generated files>
              untitled
              untitled.pro
              lpng159
              <extracted libpng files(png.c, png.h, etc)>
              png++
              <extracted png++ files(png.hpp, info.hpp, info_base.hpp, etc)>@

              1 Reply Last reply Reply Quote 0
              • K
                kwyjibo last edited by

                Anyone? I don't want to cancel the use of Qt just because their IDE can't import a simple library

                1 Reply Last reply Reply Quote 0
                • M
                  mlong last edited by

                  [quote author="kwyjibo" date="1331163269"]Anyone? I don't want to cancel the use of Qt just because their IDE can't import a simple library[/quote]

                  That's a pretty bold statement. I wouldn't chalk up the fact that you're having problems as "their IDE can't import a simple library." Thousands of developers write millions of lines of code every day using the IDE, and I haven't heard of library importing being a huge stumbling block. Typically it works very well.

                  On a more helpful track, though, do you know for sure if the $$PWD refers to your untitled/ directory at build-time? or if it refers to untitled-build-desktop-* ? (I don't remember the semantics of it offhand.) You might try turning off shadow build in your project preferences, to see if that makes a difference.

                  Software Engineer
                  My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post