Error building a very simple project with Qt Creator on Windows



  • I have a very simple project. Main .pro file:

    @
    TEMPLATE = subdirs

    SUBDIRS = sub_image

    sub_image.subdir = image
    @

    And library .pro file:

    @
    DESTDIR = ../bin
    TEMPLATE = lib
    CONFIG += staticlib

    OBJECTS_DIR = ../build
    MOC_DIR = ../build
    UI_DIR = ../build
    RCC_DIR = ../build

    HEADERS +=
    src/image.h

    SOURCES +=
    src/image.cpp

    win*{
    QMAKE_CXXFLAGS += /MP
    CXXFLAGS += /favor:blend
    }
    @

    When I build it for the first time from scratch it builds fine. However, if I delete the "build" folder where .obj files are, it's not rebuilt as usually, instead I get the error:

    C1083: Cannot open compiler generated file: '..\build\image.obj': No such file or directory

    Although when I invoke build, I see in the compile output that compiler is actually being called:

    @cd image\ && K:\Qt\qtcreator-2.7.0\bin\jom.exe -f Makefile
    K:\Qt\qtcreator-2.7.0\bin\jom.exe -f Makefile.Debug
    cl -c -nologo -Zm200 -Zc:wchar_t- /MP -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"k:\Qt\4.8.4\include\QtCore" -I"k:\Qt\4.8.4\include\QtGui" -I"k:\Qt\4.8.4\include" -I"k:\Qt\4.8.4\include\ActiveQt" -I"..\build" -I"k:\Qt\4.8.4\mkspecs\win32-msvc2010" -Fo..\build\ @C:\Users\Alex\AppData\Local\Temp\image.obj.7484.15.jom
    image.cpp@

    And if I delete "bin" folder, I get:

    @
    cd image\ && K:\Qt\qtcreator-2.7.0\bin\jom.exe -f Makefile
    K:\Qt\qtcreator-2.7.0\bin\jom.exe -f Makefile.Release
    lib /NOLOGO /OUT:..\bin\image.lib @C:\Users\Alex\AppData\Local\Temp\image.lib.6088.0.jom
    LINK : fatal error LNK1104: cannot open file '..\bin\image.lib'@

    If I invoke qmake from Qt Creator and then build - it builds fine, but that's not very convenient.

    Here's the full project:

    https://docs.google.com/file/d/0B8Qc2atC6FVKQ2RyOFdkWDdBZXM/edit?usp=sharing

    My other projects don't exhibit this weird behavior. Any advices on fixing welcome.



  • A new issue: after some doing very minor edits to the main .pro file (like reordering lines), I'm getting this message when launching build:

    Error: dependent 'image-make_default' does not exist.

    the "image" sub-project builds fine if I right-click it and select "Build", but not the main subdirs project. This happens if the subdirs project doesn't have

    @CONFIG = ordered@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.