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 8200003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:17:13+00:00 2026-06-07T06:17:13+00:00

I get the following error(s) when compiling: 3>Time Elapsed 00:00:00.10 2>ClCompile: 2> Main.cpp 2>

  • 0

I get the following error(s) when compiling:

3>Time Elapsed 00:00:00.10
2>ClCompile:
2>  Main.cpp
2>  CWnd.cpp
2>c:\repo\~\clabel.hpp(11): error C2061: syntax error : identifier 'CWnd'
2>c:\repo\~\cbutton.hpp(11): error C2061: syntax error : identifier 'CWnd'
2>c:\repo\~\cmainwnd.hpp(9): error C2504: 'CWnd' : base class undefined
2>  CMainWnd.cpp
2>  CLabel.cpp
2>  CException.cpp
2>  CButton.cpp
2>  Generating Code...
2>
2>Build FAILED.

My project looks like this (where each part includes the header file one level above)

DefaultHeader.hpp : (windows.h, includes CInterface.hpp, other header files)
-- CInterface.hpp : (includes DefaultHeader.hpp, CWnd.hpp, CLabel.hpp and CButton.hpp)
-- -- CWnd.hpp : (includes CInterface.hpp)
-- -- CLabel.hpp : (includes CInterface.hpp)
-- -- CButton.hpp : (includes CInterface.hpp)

Here is the definition of CWnd

#ifndef __CWnd_hpp__
#define __CWnd_hpp__

#pragma once

#include "CInterface.hpp"

class CWnd
{
...
};

#endif // __CWnd_hpp__

I am unsure why I get this error when trying to access CWnd, as CWnd (and all its members) are clearly defined.

The 3 lines the errors occur (snipped out, for reference):

CLabel ( CWnd* wndParent, INT iX, INT iY, INT iWidth, INT iHeight, LPCTSTR lpszCaption );

CButton ( CWnd* wndParent, INT iX, INT iY, INT iWidth, INT iHeight, LPCTSTR lpszCaption );

class CMainWnd : public CWnd

Strangest part is Itellisense sees no errors until I compile, then they appear and disappear about 2 seconds later.

Any help is appreciated.

  • 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-07T06:17:15+00:00Added an answer on June 7, 2026 at 6:17 am

    Turns out the header file CInterface was locking up and not including CWnd.hpp in some files. I fixed this issue by having all files include the highest level include file DefaultHeader.hpp instead if their corresponding include files CLabel.hpp, CButton.hpp, etc.

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

Sidebar

Related Questions

When compiling this code I get the following error : In function 'int main()':
I get the following error compiling with make (I have cygwin.dll) *** Couldn't reserve
I get the following error when compiling my app. warning: class 'ConfigureViewController' does not
I get the following error message (reduced to the important part) when I'm compiling
I get the following error when compiling a simple C# console app from MSDN
I get the following error when compiling the std::find_if function: error C2451: conditional expression
I get the following error when compiling my project for the device, but not
I get the following error: error C2102: '&' requires l-value when compiling the following
I get the following error pretty regularly when compiling in Visual Studio and running
I get following error (SyntaxError): missing ] after element list when using eval function.

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.