473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Compile error c2653: Addition of header and source file to a project

105 100+
Hi all,

I have a source file a.cpp in my project. To this project I have added a new source file (b.cpp) which is not even compiled and also header file (b.h) in which I have declared a class b and all the member functions. I have included this header file b.h in b.cpp and by right clicking the b.cpp file, I used the compile option.

When I try to compile b.cpp gives me an error : b is not a class or a namespace and more errors like some identifiers not defined..

I have added these new header file and .cpp because I want to use the functions of b.cpp in a.cpp.

Could anyone please tell me how I can compile b.cpp and use the member functions of b.cpp in a.cpp.

Thanks.
Apr 11 '07 #1
4 2712
Ganon11
3,652 Expert 2GB
What compiler are you using to compile? This is more a clarification question, as it seems like it's inconsequential.

It could be that there's a simple mistake in b.h like a missing semicolon which is screwing up the class declaration.
Apr 11 '07 #2
mickey22
105 100+
The compiler that I am using is Intel c++compiler and it is Visual 2005 (using windows).

I checked the class definition in the header file.Still I am getting the same errors.For some reason it is not considering this class.

Do I need to change any properties or anyhting you could suggest??
Thanks again for your reply.
Apr 11 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
I did what you said yuou did and it works fine.

Now I need to see your b.h and b.cpp.
Apr 12 '07 #4
mickey22
105 100+
Actually I did not change some variables and they were errros.Now it works fine.Thanks a lot.
Apr 13 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: yanwan | last post by:
Hello I am now compling a project, but in one source file of this project, I met this problem. It seems very strange. Below is this source file: ----------------------------------------...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
4
by: yanwan | last post by:
Hello I am now compling a project, but in one source file of this project, I met this problem. It seems very strange. Below is this source file: ----------------------------------------...
3
by: Jack | last post by:
I'm new to Visual C++ for .NET and during learning I encountered the following: In Form1.h file inside class Form1 following the book example I defined fuction that looks like this: (file...
2
by: Qiao Yun | last post by:
I used vc++.net (visual studio .net ) to open a project which can work well in vc++6.0. I succeeded in compiling the project in vc++.net in release mode . But when I tried to compile the project...
2
by: Bill Davidson | last post by:
All: I recently had to include a common header file into a straight C (.c file). This header file contains a function prototype that has a default argument. For example int MyFunc(int MyArg =...
5
by: Torben Laursen | last post by:
Hi Often I just want to compile one c++ file in a project the check it for errors. Now I can right click on a *.cpp file and select "Compile" But is there a way and short cut to compile a file...
0
by: nventure | last post by:
Hello, Using VS 2005 with SP1, managed C++. After installing security update for MS.NET framework 2.0 KB928365 my project fails to compile with error "C2653: 'BLib' : is not a class or...
0
by: dot | last post by:
I spent a few headache filled days trying to use GMP on windows (XP pro) I finally got it to work and since I found little help on the Web I thought someone might find what i did useful. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.