Important: Please read the Qt Code of Conduct -

Undefined reference to `_imp___ZN7CxImageC1Ej'

  • I have a project "here":
    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.

  • Come on, anyone?

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

  • 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++")

  • Sorry guys, I didn't know that you had to set some permissions on the rapidshare account. Here's the dropbox "link":

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

  • It compiles ok if change
    @CONFIG += plugin@


    @CONFIG += plugin static@


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

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

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

  • Yes. If it is possible.

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

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

    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'

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

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

  • 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.Save("Test.pcx", CXIMAGE_FORMAT_PCX))
    cout << "Successfully saved the image.\n";
    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.

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

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

Log in to reply