don't understand why I am getting error C2629: unexpected 'myclass ('

Posted on 2004-04-05
Last Modified: 2013-11-20

I am breaking a large (~40K line) monolithic program down into multiple dll's.  In the course of this, I am having to change the way include files are handled.  For the include of one of my dialog classes, I changed the order of includes at the top of the header and now I keep getting

error C2629: unexpected 'myclass('

at the constructor line.

I have even commented _everything_ out above the class declaration & I still get the error.  Code is below:

class select_view_sort : public CDialog
// Construction
      select_view_sort( CWnd* pParent = NULL,
                                    influx* ptr_hardware = NULL,
                                    class sort_control* ptr_msc = NULL,
                                    class depProc* ptr_depProc = NULL );   // standard constructor

      BOOL Create(int x,int y);
      void right_sort_done(void);

Any suggestions on how to troubleshoot this?

Question by:jesterepsilon
  • 2
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 250 total points
ID: 10762417
This can be caused by out-of-sync precompiled header files. Remove the file that stores the precompiled header information (you can find out which file this is by checking the project settings).
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10762433
Correction: Not which file, but wether you are using precompiled headers. The file is a .pch file in your Debug or Release directory (or whatever your output directory is).
LVL 49

Expert Comment

ID: 10762863
If it is a precompiled header problem, then selecting "Clean" before "Rebuild" will usually fix the problem.

If that does not help, then you need to look at each of the headers that is included.  I'll guess that there is a missing } or something like that.

-- Dan
LVL 44

Accepted Solution

AndyAinscow earned 250 total points
ID: 10763840
instead of
select_view_sort( CWnd* pParent = NULL,
                              influx* ptr_hardware = NULL,
                              class sort_control* ptr_msc = NULL,
                              class depProc* ptr_depProc = NULL );   // standard constructor

select_view_sort( CWnd* pParent = NULL,
                              influx* ptr_hardware = NULL,
                              sort_control* ptr_msc = NULL,
                              depProc* ptr_depProc = NULL );   // standard constructor

if that doesn't work then add the following lines
class sort_control;
class depProc;

class select_view_sort : public CDialog

and see if that makes any difference.

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 43
sameEnds challenge 3 161
no14 challenge 14 69
abstract class with all non abstract mentods 6 76
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question