I am trying to use the Makefile, Project, and Workspace Creator (MPC) tool to create a Visual C++ Project (7.1) file that can compile UIC files. I use the default base project file provided by MPC to achieve this (qt.mpb). The problem is, when I create the Visual C++ project file, load it into the Visual C++ environment, and click the 'Build' command, the build fails because the CPP file that UIC creates does not get compiled, and therefore the link step fails (because there is no object file).

Here is a detailed example:

At first, I have two files: main.cpp and options.ui.

I then use the following MPC file to create the Visual C++ project file:

project: qt {

UIC_Files {
options.ui
}

MOC_Files {
options.h
}

Source_Files {
main.cpp
options.cpp
options_moc.cpp
}

}

Here is the output from the Visual C++ build step:

Invoking C:\Qt\3.3.5\bin\uic on options.ui
Invoking C:\Qt\3.3.5\bin\moc on uic_generated\options.h
Compiling...
options_moc.cpp
main.cpp
Generating Code...
Linking...
LINK : fatal error LNK1104: cannot open file '.\Debug\MPC_Qt_Proj\options.obj'

As you can see, options.cpp was not compiled (and therefore options.obj was never created and the link step fails). I believe the reason that options.cpp was not compiled is because that file is not listed as an output of the Custom Build Step of the UIC file.

If anyone else has run across this problem and know some fixes, I would be very appreciative.

Thank you in advance for your help.