Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Undefined reference to `_imp___ZN7CxImageC1Ej'
QtWS25 Last Chance

Undefined reference to `_imp___ZN7CxImageC1Ej'

Scheduled Pinned Locked Moved QML and Qt Quick
17 Posts 3 Posters 6.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.
  • M Offline
    M Offline
    mahirzukic2
    wrote on last edited by
    #1

    I have a project "here":http://rapidshare.com/files/2144362146/myproject.zip
    You first need to compile and build "imagelib", then "CxImage" (which is inside of PCXFilter), and then PCXFilter (since it requires the libraries from the other two). I have made them in Qt Creator 2.4.1 which is based on Qt 4.7.4 (32 bit) minGW compiler v4.4.

    When I start to compile PCXFilter, it compiles OK, but then gives me this error: "Undefined reference to `_imp___ZN7CxImageC1Ej'" and a bunch of others like that, even though I have linked it in the PCXFilter's .pro file. Maybe I am just doing it wrong. Does anyone mind taking a look at it, and telling me whats wrong. All the paths are set up properly for the outputs. So you can easily just build these project in the given order and you will encounter the same error.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mahirzukic2
      wrote on last edited by
      #2

      Come on, anyone?

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

        Unable download your project
        "Download permission denied by uploader. (0b67c2f5)"

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tzander
          wrote on last edited by
          #4

          Ideas;
          maybe link statically to the stuff that you get linking errors to.

          Maybe you need to check symbol exporting to make use of them in your app. (google for "symbol visibility in C++")

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mahirzukic2
            wrote on last edited by
            #5

            Sorry guys, I didn't know that you had to set some permissions on the rapidshare account. Here's the dropbox "link":http://dl.dropbox.com/u/98832977/myproject.zip

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mahirzukic2
              wrote on last edited by
              #6

              Please guys, I really need this, if someone could take a look.

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                qxoz
                wrote on last edited by
                #7

                It compiles ok if change
                @CONFIG += plugin@

                to

                @CONFIG += plugin static@

                in PCXFilter.pro

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mahirzukic2
                  wrote on last edited by
                  #8

                  It should only be plugin, so it generates a dll file to be used in another application.

                  1 Reply Last reply
                  0
                  • Q Offline
                    Q Offline
                    qxoz
                    wrote on last edited by
                    #9

                    I think you can't build shared library which includes separate static libraries. In this case maybe good solution is include sources of imagelib and CxImage into PCXFilter.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mahirzukic2
                      wrote on last edited by
                      #10

                      How do you mean include those sources? You mean physically copy those files into PCXFilter folder and include them in .pro file?

                      1 Reply Last reply
                      0
                      • Q Offline
                        Q Offline
                        qxoz
                        wrote on last edited by
                        #11

                        Yes. If it is possible.

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mahirzukic2
                          wrote on last edited by
                          #12

                          I have just done that and have the .pro file in the following manner:
                          @HEADERS +=
                          pcxfilter.h
                          pcxfilter_global.h
                          color.h \ <-new ones from imagelib
                          format.h
                          etc.
                          interfaces/effectinterface.h \ <-new ones from imagelib
                          interfaces/exportimportinterface.h
                          etc.
                          CxImage/lib_export.h \ <-new ones from CxImage
                          CxImage/xfile.h
                          etc.

                          SOURCES +=
                          pcxfilter.cpp \ <-new ones from imagelib
                          color.cpp
                          etc.
                          CxImage/ximage.cpp \ <-new ones from CxImage
                          CxImage/ximapcx.cpp
                          etc.@

                          I receive the folllowing errors: (I've included some, the others look like these, just different files)
                          @ exportimportinterface.h: No such file or directory
                          ximage.h: No such file or directory
                          'img' was not declared in this scope
                          expected type-specifier before 'CxIOFile'
                          @

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mahirzukic2
                            wrote on last edited by
                            #13

                            Come on guys, I really need this in the following day. I've done everything I could think of, but I still get errors.

                            1 Reply Last reply
                            0
                            • Q Offline
                              Q Offline
                              qxoz
                              wrote on last edited by
                              #14

                              Please be patient. As soon as I or somebody from this forum will have some free time, we will try to help you with solving your problem. For now look at the *.pro file from imagelib, as you can see not all sources from directory included in project.

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                mahirzukic2
                                wrote on last edited by
                                #15

                                I've managed to compile and link cximage library using Code:Blocks (which has newer version of MinGW 4.7, which might be the problem, cximage library wasnt linking properly in QtCreator with MinGW 4.4). I have also tested the following code: (which I linked with libcximage.a i libgdi32.a libraries), and this code works. This was also compiled and linked in Code::Blocks.
                                I have downloaded Qt5.0.1 which has MinGW 4.7 integrated, so I'll try with that.

                                //////////////////////////////////////////////////////
                                #include <iostream>
                                #include <ximage.h>

                                using namespace std;

                                int main()
                                {
                                CxImage img;
                                img.Load("Pesti_BASH.pcx", CXIMAGE_FORMAT_PCX);
                                if(img.IsValid()){
                                if(img.Save("Test.pcx", CXIMAGE_FORMAT_PCX))
                                cout << "Successfully saved the image.\n";
                                else
                                cout << "Failed to save the image.\n";
                                } else {
                                cout << "Not a .pcx format or corrupted image.";
                                }
                                return 0;
                                }
                                //////////////////////////////////////////////////////

                                By the way, does anyone know why is QtCreator so problematic. I have also noticed that Code::Blocks has much better project configuration in comparison with QtCreator, which is comprised of .pro file, which you need to edit by yourself, knowing all the variables that need to be declared beforehand.

                                1 Reply Last reply
                                0
                                • Q Offline
                                  Q Offline
                                  qxoz
                                  wrote on last edited by
                                  #16

                                  Yes you are right QtCreator not perfect and it has many problems for now. But good thing is, tool continues evolving and i hope situation will change for the better.

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    mahirzukic2
                                    wrote on last edited by
                                    #17

                                    Guys I have been just told that I need to use the version of the compiler that will be compatible with both Windows and Linux, which is MinGW but 4.4 version, the one I've started using at the beginning. Please help me guys.

                                    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