Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8960581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:41:27+00:00 2026-06-15T15:41:27+00:00

My IDE: Visual Studio 2010, I use Qt add-in for VS, Qt ver. 4.8.1

  • 0

My IDE: Visual Studio 2010, I use Qt add-in for VS, Qt ver. 4.8.1

I have faced with the problem while trying to create precompiled header(pch) in my Qt project.

My usuall approach for creating pch in non Qt project is:

  1. Create header;
  2. Include files which will be precompiled in header;
  3. For every source file in the project state in it`s properties if it will use pch;
  4. For one source file in project state creation of pch;
  5. Include pch in all source files.

As those action failed for Qt project I decided what it happens due to pch should be included to all files generated by MOC.

I read the article in QtAssistant on precompiled headers and did the following:

  1. Created header file;

  2. For all .cpp files in project set option use pch and for one create

  3. Converted to qmake generated project

  4. I ran qmake -project

  5. I modified generated .pro file, here it is:

    TEMPLATE = app
    TARGET =
    DEPENDPATH += . GeneratedFiles
    INCLUDEPATH += .
    PRECOMPILED_HEADER = StdAfx.h
    QT += network

    Input

    HEADERS += server.h StdAfx.h
    FORMS += server.ui
    SOURCES += main.cpp server.cpp StdAfx.h.cpp
    RESOURCES += server.qrc

  6. I ran qmake

  7. open .pro file and tried to build it and got the error:

    Error 2 error C1083: Cannot open include file: ‘StdAfx.h’: No such file or directory

What I am doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:41:29+00:00Added an answer on June 15, 2026 at 3:41 pm

    I found solution.
    The only thing needed to be done in order to use precompiled header in project is to include
    the following statements in .pro file:

    CONFIG += nameOfPrecompiledHeader.h
    PRECOMPILED_HEADER = nameOfPrecompiledHeader.h
    win32-msvc* {
    PRECOMPILED_SOURCE = nameOfFileInWhichCreateOptionWillBeSet.cpp /* other .cpp files will be with use option*/
    }
    

    after .pro modification and running qmake all .cpp files will be set up for usage of pch and one for it`s creation(nameOfFileInWhichCreateOptionWillBeSet) and .pch will be generated

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently written a macro for visual studio 2010 in the macro IDE,
I only use one IDE (Visual Studio 2010), and preferred to stick with one
I have a VB.NET project in Visual Studio 2010 for an Excel Add-In. I
Is there a way to use the Visual Studio 2010 IDE with the Small
I'm building an application using Visual Studio 2010 in which I have to use
When attempting to use the profiler in Visual Studio Ultimate 2010, the IDE throws
I want to use Visual Studio (maybe Isolated Shell) to create a custom IDE
I create a ASP.net MVC 4 project by using Visual Studio 2010 IDE. I
Good day, IDE Visual Studio 2010 .NET 3.5 Platform WinForms The SO question difference
I am new to .NET and the Visual Studio IDE. How to I add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.