|
-
.h file extensions and compiler tool
I am new at this. I am trying to set up a header file in the C++ compiler
-- very unsuccessfully so
far. My code builds just fine, no errors or warnings. However, when I try
to compile it, I get the
message that there is "no compile tool associated with the .h file extension.
I have trashed
my code and project file and started new several times. I have uninstalled
the Visual C++ compiler
and then did a complete reinstall. Nothing helps. Here is the code that
I am trying to compile:
#include <iostream.h>
class Cat
public:
Cat (int initialAge);
~Cat();
int GetAge() const { return itsAge;}
void SetAge (int age) { itsAge = age;}
void Meow() const { cout << "Meow.\n";}
private:
int itsAge;
};
PLEASE DON'T suggest that I ad the #ifndef, #define, #endif to the code it
does not work, I have
already tried it. And again, it builds error and warning free, but it will
not compile and I get the same
message.
I had someone else write this code on his computer and he did not have any
trouble compiling it. I
took what he wrote and tried to compile it on my computer and it would not
compile!
What am I doing wrong???? After less than a week into this stuff and I am
ready to give up!
Here are the steps that I have gone through to set up the header file:
Using the Win32 Console Application, I set up a new (empty) project. Then
I select "New"
and "C++ header file", name it and tell it to add it to the project. Then
I enter the code which
builds without error. It will not compile!
IS THERE ANYONE OUT THERE WHO CAN HELP ME??? I REALLY WOULD APPRECIATE IT!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks