⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

QtCreator linking problem

  • I am having this problem building a sub-project in QtCreator, which builds outside in MS VS 2008 with Qt plugins and on the command line with a qmake and nmake call. I have gotten other sub-projects in the project to build, but this one is exhibiting linker errors for unresolved symbols for some STL IO stream code generated by XSD. The symbols are in the code and appear to be in the obj file that is included for linker, and calling nmake will link it and create the dll.

    Other think I noticed that either in QtCreator or by calling qmake seems to call the .pro file 3 times because I get the following output:
    Project MESSAGE: debug set
    Project MESSAGE: Debug build!
    Project MESSAGE: debug set
    Project MESSAGE: Debug build!
    Project MESSAGE: release set
    Project MESSAGE: Debug build!

    Generated from the following lines in the .pro file:

    at the top

    CONFIG(release, debug|release):message(release set) #will print
    CONFIG(debug, debug|release):message(debug set) #no print

    for some reason, on the third time though it is defined as release, so I applied the following

    CONFIG += debug

    in the middle

    CONFIG(release, debug|release){
    message(Release build!)

    CONFIG(debug, debug|release){
    message(Debug build!)

    If anyone has some idea, why this behavior with QtCreator or qmake calling the .pro file three times, I would like hear it.

    I am using these Qt products on a Windows 7 with VS 2008:
    QtCreator 2.2.1
    Qt 4.7.3



  • BTW, I also tried changing out jom for nmake, but no joy.

  • All Qt Creator does is to run qmake and make (or nmake, mingw-make or jom or however it happens to be called on windows;-). So it is surprising to me that qmake/make works but Qt Creator does not. Try running the exact commands Qt Creator does (they are printed in the build output and visible in project mode) and see whether that works or not.

    Yes, Qmake parses the .pro files several times. That is normal for qmake.

  • I tried rerunning the link line from the creator output, but there is a temp file, <something>.jom, in a temp directory that is deleted as the make exits. The line at the end of the link line looks like this:

    I have noticed that changes where directories are for intermediate files which doesn't happen with a strict qmake and nmake.

    What is the purpose of the multiple passes? If I set CONFIG in the .pro file to debug or release, am I messing some functionality up?

  • are you really literally using "CONFIG" as scope? if so, what do you want to achieve?

Log in to reply