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'

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.
  • 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