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

  • Home
  • SEARCH
  • 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 8012689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:24:06+00:00 2026-06-04T19:24:06+00:00

The following include on a Qt project is conflicting with my user defined classes:

  • 0

The following include on a Qt project is conflicting with my user defined classes:

#ifdef Q_OS_WIN
#include "qt_windows.h"
#include "qwindowdefs_win.h"
#include <shellapi.h>
#endif

Code Snippet:

 if (Desktop::MessageBox::question(this, tr("I am ready?"),
                                     tr("I am not ready yet!?")) == QDialog::Rejected )
            {
                TRACE("Dialog rejected. I am not ready yet.");
                return;
            }

Errors:
\Desktop\Gui\MainScreen.cpp:953: error: ‘Desktop::MessageBoxA’ has not been declared

My Desktop::MessageBox is conflicting with windows defined MessageBoxA. What is the standard solution for this problem in c++?

  • 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-04T19:24:09+00:00Added an answer on June 4, 2026 at 7:24 pm
    1. #undef MessageBox (and other conflicting names), or

    2. Rename your class, or

    3. Encapsulate your usage of the Windows API into separate .cpp files so that you don’t need to include the Windows headers everywhere, thus (largely) avoiding the problem.

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

Sidebar

Related Questions

I currently have the following models/toy.rb file in my RoR project: class ToysPurchased include
The following code #include <iostream> using namespace std; int main() { const char* const
I have the following code: #include <iostream> using namespace std; struct stud{ int roll;
In my JSF2 project I want to include following two style sheet to my
I've a question regarding the following code: #include all_needed.h static uint8_t array[2] = {0};
everybody out there i write a very simple c code which is following: #include<stdio.h>
I have the following class in my sinatra app (app.rb) class Project include DataMapper::Resource
i am developing a 3d project and would like to include the following feature
i have following code #include <iostream> #include <string> using namespace std; string generate(){ for
Hi I have a visual studio project which includes postbuildevents in the following form:

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.