This should win the stupid question of the day, but here goes.
I am using the Borland BCC5.5 compiler. Now that I started working with classes, I need to link the .cpp and .h files but cant quite figure out how. Any help would be appreciated.
This should win the stupid question of the day, but here goes.
I am using the Borland BCC5.5 compiler. Now that I started working with classes, I need to link the .cpp and .h files but cant quite figure out how. Any help would be appreciated.
I have not worked with the compiler, but if it is like any other compiler, you need to include both of those files to your project and use #include statements to link the headers.
I've included the #include lines. I'm not sure about the project part.
Code:// Class header #ifndef BLAH #define BLAH class blah { ... }; #endifCode:// Class implementation #include "blah.h" ...To compile and link, do this (IIRC):Code:// main.cpp #include "blah.h" int main() { blah b; ... }
Code:C:\bcc32 blah.cpp main.cpp
My best code is written with the delete key.
I'll give it a try, thanks. Do I need to do anything with the header file?
>Do I need to do anything with the header file?
No, the header file is only used so that multiple source files can see the declarations. The linking stage makes no use of it.
My best code is written with the delete key.
It looks like it compiled ok. Do I then just type in main to run the program or do I need to do something else?
>Do I then just type in main to run the program or do I need to do something else?
For the life of me I can't remember what Borland saves the executable as. Check the directory and see what the .exe file is named, then just run that program.
My best code is written with the delete key.
Will do. Thanks for the help.
bcc32 pgm.cpp subs.cppOriginally Posted by Prelude
will create pgm.exe
It's the name of the first source file on the line.
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers