why the build error?

I got the build error said:

"c:\Temp\coefCalculator.h(10): error C2011: 'CoefCalculator' : 'class'
type redefinition".

I checked the code. Only one place defined the class. Why I got this
message?

0
yqin_99 (193)
3/11/2006 7:23:42 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
295 Views

Similar Articles

[PageSpeed] 53

Is your header file wrapped inside a #ifndef like this:-

#ifndef COEFCALCULATOR_H
#define COEFCALCULATOR_H

class CoefCalculator {
.....
}
#endif

-- 
Vipin Aravind
http://www.explorewindows.com


"kathy" <yqin_99@yahoo.com> wrote in message 
news:1142105022.232791.227650@v46g2000cwv.googlegroups.com...
>I got the build error said:
>
> "c:\Temp\coefCalculator.h(10): error C2011: 'CoefCalculator' : 'class'
> type redefinition".
>
> I checked the code. Only one place defined the class. Why I got this
> message?
> 


0
vipin (697)
3/11/2006 7:30:20 PM
"Vipin [MVP]" <Vipin@nospam.com> wrote in message 
news:u9Iy%23IURGHA.3972@TK2MSFTNGP10.phx.gbl...
| Is your header file wrapped inside a #ifndef like this:-
|
| #ifndef COEFCALCULATOR_H
| #define COEFCALCULATOR_H
|
| class CoefCalculator {
| ....
| }
| #endif
|
| -- 
| Vipin Aravind
| http://www.explorewindows.com
|
|
| "kathy" <yqin_99@yahoo.com> wrote in message
| news:1142105022.232791.227650@v46g2000cwv.googlegroups.com...
| >I got the build error said:
| >
| > "c:\Temp\coefCalculator.h(10): error C2011: 'CoefCalculator' : 'class'
| > type redefinition".
| >
| > I checked the code. Only one place defined the class. Why I got this
| > message?
| >
|
|
This is a FAQ.  Does anyone here do FAQ's for this forum?

-- Ed.

The 'Dick Cheney': A glass of beer and a shot of Old Grandad
-----------------------------------------------------

0
Anon3258 (180)
3/11/2006 8:10:02 PM
Maybe you included 'CoefCalculator.h' in your .cpp file and in the .h
file, like this:

//MainClass.h

#include "CoefCalculator.h"

class MainClass{
....
};

and in the implementation:

//MainClass.cpp

#include "CoefCalculator.h"
#include "MainClass.h"

MainClass:MainClass()
{
....
}

....


just include CoefCalculator in the definition file .h or put in the
CoefCalculator.h a preproccessor directive

#ifndef COEFCALCULATOR_H
#define COEFCALCULATOR_H

class CoefCalculator {
.....
}

#endif 


Good Luck
Giancarlo Berenz

0
gberenz (4)
3/11/2006 8:46:02 PM
>  This is a FAQ.  Does anyone here do FAQ's for this forum?

I  dont think so. There is one at mvps site but its not really that
exhaustive.

---------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6842)
3/11/2006 10:41:55 PM
Possibly its being included multiple times in one of the cpp files. You
can use the following pragma in your header file to avoid it:

#pragma once

-----
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6842)
3/11/2006 10:43:45 PM
Or you could use #pragma once... I love #pragma once :o)

Tom

"Vipin [MVP]" <Vipin@nospam.com> wrote in message 
news:u9Iy%23IURGHA.3972@TK2MSFTNGP10.phx.gbl...
> Is your header file wrapped inside a #ifndef like this:-
>
> #ifndef COEFCALCULATOR_H
> #define COEFCALCULATOR_H
>
> class CoefCalculator {
> ....
> }
> #endif
>
> -- 
> Vipin Aravind
> http://www.explorewindows.com
>
>
> "kathy" <yqin_99@yahoo.com> wrote in message 
> news:1142105022.232791.227650@v46g2000cwv.googlegroups.com...
>>I got the build error said:
>>
>> "c:\Temp\coefCalculator.h(10): error C2011: 'CoefCalculator' : 'class'
>> type redefinition".
>>
>> I checked the code. Only one place defined the class. Why I got this
>> message?
>>
>
> 


0
tserface (3860)
3/13/2006 3:42:50 PM
Hi Ed,

Here are a couple good ones.  The one Tomas keeps up is mostly for managed 
FAQs.

http://www.winterdom.com/mcppfaq/
http://www.mvps.org/vcfaq/

Tom

"Ed Weir (ComCast)" <Anon@Maus.duh> wrote in message 
news:dbOdncpSTqPrs47ZnZ2dnUVZ_t2dnZ2d@comcast.com...
> "Vipin [MVP]" <Vipin@nospam.com> wrote in message
> news:u9Iy%23IURGHA.3972@TK2MSFTNGP10.phx.gbl...
> | Is your header file wrapped inside a #ifndef like this:-
> |
> | #ifndef COEFCALCULATOR_H
> | #define COEFCALCULATOR_H
> |
> | class CoefCalculator {
> | ....
> | }
> | #endif
> |
> | -- 
> | Vipin Aravind
> | http://www.explorewindows.com
> |
> |
> | "kathy" <yqin_99@yahoo.com> wrote in message
> | news:1142105022.232791.227650@v46g2000cwv.googlegroups.com...
> | >I got the build error said:
> | >
> | > "c:\Temp\coefCalculator.h(10): error C2011: 'CoefCalculator' : 'class'
> | > type redefinition".
> | >
> | > I checked the code. Only one place defined the class. Why I got this
> | > message?
> | >
> |
> |
> This is a FAQ.  Does anyone here do FAQ's for this forum?
>
> -- Ed.
>
> The 'Dick Cheney': A glass of beer and a shot of Old Grandad
> -----------------------------------------------------
> 


0
tserface (3860)
3/13/2006 3:42:55 PM
Reply:

Similar Artilces:

Error message 0x800cccoe Port 25 socket error 10060
I have Windows 7 home premium. Windows live mail receives messages but I am unable to send them. The error message also states that Windows live mail cannot connect with the Comcast server. I am able to send and receive through Comcast Smartzone, but not with live mail. I want to be able to have live mail connect with the Comcast server. Thanks for any help, tubbman. Change the SMTP port to 587 and make sure: My Server Requires Authentication is checked. How do I set up/configure Outlook Express & Windows Mail for Comcast email? http://www.comcast.com/customers/faq/FaqDe...

Outbind error in Outlook 2003
I recently purchased Outlook 2003 for the purpose of using the new mail filtering. So far so good. But when I print to a network printer (I'm on a single domain using Exchange 2000) in Outlook, I have the server setup to respond with a Messenger message to let me know the print job succeeded. It works perfectly in Word, Excel and Powerpoint. Outlook, instead of saying "Document name" printed successfully on Printername on \\Servername (as the other parts of Office do), instead says "outbind://1- 00000000D59E0B25F166A04BB9A11BF4C3CC2ED0700ED1EC63" printed succes...

Building Assembly
I'm trying to build an assembly that creates a directory that is named after an attribute in opportunities. this is what I have, and it is not compiling into a dll, any advice? public string CreateDirectory(string root,string folderName) { } Luke Davis, MCSE: Security DEM Networks - Senior Systems Architect 7225 N First, Suite 105 Fresno, CA 93720 Office: 1 (559) 439-1000 Fax: 1 (866) 640-2041 www.demnetworks.com ...

Money 2005 error with session Reference # 2000
I was trying to download my account info from Wachovia and it said that my account could not be updated and to tell my Customer Service Rep with Reference Number 2000. How do I fix this to update my info? Thanks! ...

Outlook 2007 error message #3
Does Outlook 2007 have an error log? My I-net mail server is having a problem. Outlook attempts to send message but after a minute or so pops up a little messsage on lower right screen saying "Error-click here to read" , or something similar but disappears before I can click on it. Is that message logges somewhere? TIA, John John Smith <oldibm66@cableone.net> wrote: > Does Outlook 2007 have an error log? If you enable, them, logs exist, but not otherwise. See this: http://support.microsoft.com/kb/300479 -- Brian Tillman [MVP-Outlook] ...

OWA Logon error
My users can not log on to OWA! We just migrated to Exchange 2003 from 5.5. If I create a new domain user and a new mail box in Active directory they can log in. But if I change there email address in the address field they can no longer log in. There must be something I need to set somewhere to correct this problem. Please help. On Tue, 24 May 2005 10:54:03 -0700, "Shane" <Shane@discussions.microsoft.com> wrote: >My users can not log on to OWA! We just migrated to Exchange 2003 from 5.5. >If I create a new domain user and a new mail box in Active directory they ca...

file already open error
Hi Every time I open a saved excel spread sheet I receive this error: A document with the name 'add-in name' is already open. You cannot open two documents with the same name, even of the documents are in different folders." If I open the file by using the File, Open menu and navigate to the file, I do not receive the error. It's only when I click on the file which is on the desktop and open it that way , do I receive the error There are no other files open at the time. Rebooting does not solve the problem. WE are running Windows XP SP2 and Excel 97 Thanks in advance...

building a worksheet row by row
I hope somebody can assist. My worksheet calculates rows of data, which I wish to slide into another worksheet and secure; then change the original data, slide those results under the first. Keep repeating. Is there a way to do this without manually pasting values each time? David Dave "Sliding" rows from one sheet to another would involve the use of VBA. See Ron de Bruin's site for moving/copying rows to next available empty rows. http://www.rondebruin.nl/copy1.htm Gord Dibben Excel MVP On Thu, 4 Nov 2004 14:04:03 -0800, "DaveButcher" <DaveButcher@discussio...

Can I Build an Access Statement (in 2007) as a String and Execute
Hi, I know that I can build a SQL statement within a string and then execute it like the following: strSQL = "UPDATE tblAuditRpt " _ & "SET tblAuditRpt.AuditRptYesCount = " & lngInitialEvalCount & " " _ & "WHERE tblAuditRpt.AuditRptID=25;" CurrentDb.Execute strSQL, dbFailOnError Can I do the same with an Access statement itself? For example, How could I execute the following statement if I built it in a string? lngInitialEvalCount = DCount ("AuditDtlCnt", "AuditDetai...

Error Importing Msg to OL Express
hi all, i had copied messages (*.dbx) files to a CD now after reinstallation am trying to import the same back to outlook express 6 but am getting the following error ________________ No messages can be found in this folder or another application is running that has the required files open. Plese select another folder or try closing applications that may have files open. ________________ Pls help i am in a mess... Thx, Niraj ...

Error in equation 'sItemNumber'
We get this error on client workstations when trying to print an invoice or sales order. I do not get it when trying to print purchasing documents. I have modified the dynamics.set file to point to the network drive with the modified reports.dic file. I do not get this message when launching GP directly from my server (logging in as the same user). This leads me to believe there is something missing from my setup instead of something wrong with my report. I'm sure it's something simple that I am missing but cannot seem to find it. Any help would be greatly appreciated! Lis...

Mail rule Error
Hi, We have a rule setup asking the server to reply with a specific message for one of our techsupport accounts. The rule reponds internal but not to external address. This worked Ok on an exchange 5.5 system but have upgraded to exchange 2003 and Outlook 2003 and it now fails. Any ideas ??? Andy Andy Judd <andyj@sci.co.uk> wrote: > We have a rule setup asking the server to reply with a > specific message for one of our techsupport accounts. > > The rule reponds internal but not to external address. > > This worked Ok on an exchange 5.5 system but have > up...

Error 0x800ccc19
I am not able to send or receive email in Outlook 2000. The error message I get says a "timeout occurred while communicating with the server" This was not a problem previously, but it just started happening. Can anyone please help me resolve this? I do use McAfee for a virus scanner, and I dont know if that is what is preventing me from getting my emails. Thanks! Turn off the message scanning and increase your server timeout on the Advanced tab of your Mail Account Properties. -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact....

Error linking to my ATL dll
I'm using VS2005, building a WM5 application. The dll is a ATL com dll providing network services to my app. I've tested the dll with a simple dialog app, but now I try to link it to my application I get .... io 8\VC\ce\atlmfc\include\atliface.h(591) : error C2143: syntax error : missing ',' before '.' which points to virtual HRESULT STDMETHODCALLTYPE ShowUI( /* [in] */ DWORD dwID, /* [in] */ IUnknown *pActiveObject, /* [in] */ IUnknown *pCommandTarget, /...

error in report only when run as a subreport
I have two reports that are identical except for the underlying query. the reports show mvoement information but each report shows a different direction. I put each of these directional reports in a third report to display the directions side by side. When run individually the directional reports execute fine. When run as subreports I get divide by zero errors in a section footer of the subreports. The error does not occur when run as a stand-alone report. Any help would be appreciated. Thank you in advance for any help. -- Message posted via http://www.accessmonster.com ...

Public Folders Error Message
In Public Folders getting an error message with some (not all) contacts and calendar items when you try to open them even with admin right or ownership right. The message says "Can't open this item" unkown error. Any thoughts "=?Utf-8?B?TWhlcm5hbmRleg==?=" <Mhernandez@discussions.microsoft.com> wrote in news:165B0C43-FC8B-4EDB-938F-7CE0B97F7FC8 @microsoft.com: > In Public Folders getting an error message with some (not all) > contacts and calendar items when you try to open them even with admin > right or ownership right. The message says "...

Distmon error
I am having the same prob that everyone else is describing, however have looked on the Microsoft support forum. I did a search and did no find the 2 Adobe files anywhere on my computer. I also disabled the NAV plugin...... I am still haveing the sam prob. Is there any OTHER way to fix this without reformatting!!?? Thanks in advance -- Message posted from http://www.ExcelForum.com I think I'd shell to DOS and run an old DOS command: dir c:\pdfmak*.xla /s Or make sure you're looking through hidden folders and for hidden files, too (windows explorer setting). "spcinf <...

"This operation cannot be performed." error
Hi, I noticed recently that I got a "This operation cannot be performed." error whenever I started Money. The error details told me to run the Money file Repair tool to fix the problem. I did a level 2 repair and the report produced said "No broken records in the original file.". I still got errors when I closed and further tried to reopen the file. I then went into 'Bills' and started to delete a bill, then close/reopen Money to see the effect. It came down to a single bill. I duplicated this bill and deleted the original, now Money is working ok and not re...

ehrecvr.exe error message after installing SP3
Hi, I own a Freecom Hybrid DVB-T USB Stick which used to work fine (Was able to see TV), unfortunately since I installed SP3 for Windows XP I always get following annoying message on startup when plugging in the DVB-T USB Stick: An unhandled win32 exception occured in ehrecvr.exe The message keeps popping up every 5 seconds, until I disconnect the USB Stick. When I check the event viewer following error message is generated by the Media Center Receiver service: TV Tuner Malfunction. (0x80040265) TridVid Tv Tuner I found comments of people who experienced the same prob...

Macro to build table
I have 6 questions that may be answered yes or no, and for the sake of keeping everything in integer form, let's assume "1" for yes and "0" for no. Depending on how a customer answers all 6 questions, they will receive a predetermined score. I am attempting to develop the answer key, so-to-speak, to refer the reps to once they are finished asking the customer these questions. I was hoping for the code that would build a macro to create this tabe for me - a table that would lay out all of the 6 question-answer combinations, like the following: Questi...

Error bars not displaying
Microsoft Excel 2002 SP3. I have data that looks like this: Median Min Max Na 0.032617 0.000106 0.387142 Cl 0.0265 0.000017 0.282087 Ca 0.000524 0.0000047 0.0059883 K 0.005523 0.000007 0.038365 Mg 0.0000823 0.0000001 0.0018515 PO4 0.00031 0.00002 0.00105 HCO3 0.001655 0.000262 0.003048 I'm doing a line plot with the first column as the categorical x axis, and the second column, median, on the y-axis, which is logarithmic. I then set up error bars using the values in the min and max column (columns 3 and 4 above) as custom values in the "error amount" part of the format data ser...

Building Kits
I am having trouble using the build kits tab. I went through and made sure all the components were available to build the kits. I click the build tab and the program prompts that there is enough inventory to build 2 kits. I enter 2 and then hit the build tab and then ok. When I go to the properties screen the inventory qty is still 0. I copied the kit and gave it another name and did the same process and was able to build the kits the first and only time. Any suggestions? known bug, apply the latest hotfix and you will be good to go. "akpetshop" <akpetshop@discussions.mic...

Hq sync errors WS101
I installed a new hq installation on the first store and it synced fine, but when I sync the second store I get a error on processing the Work sheet 101: <<CstateMachine::ExecuteState>> Error -2147024770:Automation error The Specified module could not be found (unhandled error, State = 9 They are running Nitrosell and New West Tech Mobile Suite add-ins which could be causing the sync errors. Any Ideas? Thanks Dave ...

IV_Reconcile Error
Hi, I have a problem in GP 10 SP4 and SQL2005. During the inventory reconcile getting error message box : FB : Couldn't close table What could be the wrong? Tks Saf Hi Saf, Is this occuring to all workstations with GP10 SP4? Additional troubleshooting steps are running Checklinks on Inventory Series and executing grant.sql for the company database. Let us know how you go! Cheers, Dennis Araullo, MACS Microsoft Certified Technology Specialist GP,CRM,AX MCITP Installation and Configuration AX 2009 MCITP Database Administrator SQL 2008 Citrix Certified Ent...

Money 2004
Suddenly whenever I try to run Money 2004 (standard) I get a C++ Runtime error message that the application has requested the Runtime to terminate in an unusual way and that I should the application's (ie. MSMoney) support team for more information. I have made no changes to the system that I am aware of and have re-installed Money, uninstalled and re-installed it, run the repair utility on the data file, and tried to open the sample data file after re-installation. I have also performed a hard disk test and have up-to-date virus and spyware programs running at all times. Help gre...