each time when i define a header file in my main cpp and then use the classes i define in the header file in some different cpp file it gives me "undefine" error
each time when i define a header file in my main cpp and then use the classes i define in the header file in some different cpp file it gives me "undefine" error
Are you compiling on the command line or in an IDE?
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Then I will guess that you are doing something like this:
where you should do:Code:cl -o myprog main.cpp
(Alternatives do exist).Code:cl -o myprog main.cpp class.cpp
Edit: What I'm trying to say is that you need to tell the compiler which CPP files it should compile (and link). Just because you include a header file doesn't automatically mean that the source file with the implementation will be compiled/linked against.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.