Results 1 to 4 of 4

Thread: Error C1083 in Visual Studio 2013, compiler can't open Moc file

  1. #1
    Join Date
    Mar 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Error C1083 in Visual Studio 2013, compiler can't open Moc file

    Hi All

    I'm trying to compile a project in VS 2013. I'm using the 32 bit 2013 Qt version and have generated a .pro file automatically using Qt VS Add-in. I'm getting the C1083 error- the compiler can't open the moc file. This is the contents of the .pro;

    Qt Code:
    1. TEMPLATE = app
    2. TARGET = Shot_Manager
    3. DESTDIR = ../Win32/Debug
    4. QT += core widgets gui
    5. CONFIG += debug
    6. DEFINES += WIN64 QT_DLL QT_WIDGETS_LIB
    7. INCLUDEPATH += ./GeneratedFiles \
    8. . \
    9. ./GeneratedFiles/Debug
    10. DEPENDPATH += .
    11. MOC_DIR += ./GeneratedFiles/debug
    12. OBJECTS_DIR += debug
    13. UI_DIR += ./GeneratedFiles
    14. RCC_DIR += ./GeneratedFiles
    15. include(Shot_Manager.pri)
    To copy to clipboard, switch view to plain text mode 

    Anyone know what I'm doing wrong? I can see the moc files in solution explorer and they appear to be in the path specified in the MOC_DIR...

    Thanks

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Error C1083 in Visual Studio 2013, compiler can't open Moc file

    Are you building from within the VS IDE, from the command line, or using Qt Creator? If you are building from within VS IDE, then you have no need for a .pro file. Visual Studio creates a VS solution and project for you. If you are building from the command line, then you probably need to run qmake again. Likewise for Qt Creator.

  3. #3
    Join Date
    Mar 2016
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Error C1083 in Visual Studio 2013, compiler can't open Moc file

    Quote Originally Posted by d_stranz View Post
    Are you building from within the VS IDE, from the command line, or using Qt Creator? If you are building from within VS IDE, then you have no need for a .pro file. Visual Studio creates a VS solution and project for you. If you are building from the command line, then you probably need to run qmake again. Likewise for Qt Creator.
    I'm building from within the VS IDE. Ok, I'll delete the .pro file. I only created that in an attempt to fix this problem. Do you know how I can fix for VS IDE build? Thanks

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Error C1083 in Visual Studio 2013, compiler can't open Moc file

    Isn't there an item on the Qt Add-in menu for "Convert to Qt project" or something like that?

    At worst, you can back up your files somewhere, delete the project (in VS and manually), and re-create it. If you add classes with exactly the same names as your old project, you can copy the old files over top of the new ones and it should all work. You can also create the project, copy the files into the project directory, then use the "Add -> existing item" command from the right-click on the Solution browser to add the copied files into the project. As long as you be sure to create it as a Qt project, it should all work.

    Don't add anything that is auto-generated (like moc files). For Qt GUI classes, just add the .cpp, .h, and .ui files. For QObject classes, just the .cpp and .h.

Similar Threads

  1. Using Qt 5.4.1 Visual Studio 2013 libs in Visual Studio 2010
    By ^NyAw^ in forum Installation and Deployment
    Replies: 0
    Last Post: 6th March 2015, 10:20
  2. Replies: 5
    Last Post: 10th December 2014, 16:02
  3. Replies: 1
    Last Post: 10th March 2011, 14:40
  4. Replies: 3
    Last Post: 1st November 2010, 16:33
  5. Replies: 4
    Last Post: 9th May 2010, 16:18

Tags for this Thread

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.