Results 1 to 3 of 3

Thread: Using the Makefile, Project, and Workspace Creator (MPC) with UIC Files

  1. #1
    Join Date
    Jun 2006
    Posts
    2
    Qt products
    Qt3
    Platforms
    Windows

    Question Using the Makefile, Project, and Workspace Creator (MPC) with UIC Files

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Using the Makefile, Project, and Workspace Creator (MPC) with UIC Files

    I think its "PATH" related problem..your path to *.obj is incorect...Also IMHO its strange way to build qt project with Visual Studio...Have you install QMSNet2003 ?
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Jun 2006
    Posts
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: Using the Makefile, Project, and Workspace Creator (MPC) with UIC Files

    I don't think it's a PATH related problem, because the linker is able to find the other *.obj files that are created by the compiler. Also, upon inspection of the folder where all *.obj files reside, there is not one for options.obj (while there are *.obj files for main.cpp and options_moc.cpp (i.e. main.obj and options_moc.obj)).

    Furthermore, using the 'Rebuild' command (instead of 'Build') causes the program to be built correctly.

    The reason we are using MPC (as opposed to QMake) is because we have a need to integrate IDL files (CORBA) into our application, thus we need to specify the Custom Build Steps for the IDL files, which MPC can do quit easily. As far as I can tell, you cannot specify to QMake how to create Custom Build Steps for other types of files, such as IDL files.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.