Help with class definition

Started by
2 comments, last by PrinCeps 18 years, 10 months ago
Hello, i've created a class in a FileName.h class Filename { private: // blah blah public: // blah blah }; And i #include the FileName.H in FileName.cpp, when im writing the code and i write FileName:: it shows the methods i declared in the header file, so everything looks good. But when im compiling my app it says: FileName is not a class or a namespace; so after that everything is error cos it doesnt recognize any of the methods and/or attributes from that class. What happened, where is the error :( BTW im using VC++ 6.0. Thx for ur help
Advertisement
Can you show us your .cpp file?
Blake's 7 RPG - a new project
Quote:
it shows the methods i declared in the header file, so everything looks good

The code copmletion features are just there for your help. They may indicate error but don't rely on them. If the compiler does not compile, everything is not good.

The problem is that the class has the name 'Filename' while you try to refer to it by 'FileName'. Since C++ is case sensitive this is two different things. The most common use is the first one, with only one capital.

Greetz,

Illco
Wow, thx for ur quick reply.
I wrote FileName just for a general purpose, those r not the names of my files, my files are called Game.cpp and Game.h; but ive found the error (really sry to bother u guys) i made a mistake, i cahnged my Project folder and left 1 file in my old folder :/, so i was able to c the methods cos i added the file to thee project header files, but the #include "Game.h" wasnt able to find the file cos it was in another directory. So lame, lol; really sry to bother you guys, and thx for ur replies :)

This topic is closed to new replies.

Advertisement