MY PROGRAM WONT COMPILE BECAUSE OF A LINKER ERROR.

I've written a small program using separate compilation. My class is in a file called BankAccount.h and my implementation file is in a file called BankAccount.cpp but when I compile my program, it gives me an error "LINKER ERROR" and then list all my member functions and it says they are undefined. I've included the include directive #include "BankAccount.h" in both the main program and the implementation file. please assist.
make sure that both files are in the same folder.
both files are in the same folder.
Are they added to your project?
I'm sorry but im an absolute beginner. @coder777 how do i add them to my project?
Depends on your choice of IDE.
@coder777, Won't the header files processed if they were included with the #include directive irrelevant of whether they were added to the project or not?
@Pravesh Koirala
The headers: yes. The implementation files: no.



@OP
As Moschops said. How do you compile your files?
The real problem here is that you (and presumably Pravesh too) don't understand how the files are turned into a program.

Read my final post, here: http://www.cplusplus.com/forum/beginner/63140/
Last edited on
@Moschops, nice post. Cleared something for me, thanks.

And to OP
Why don't you post your code? Maybe you are misspelling some functions or perhaps you forgot to put the scope resolution operator (::).
i have one question though. when you use separete compilation, do you have to compile all the files separetely or can u just compile only the main prgarm.
Topic archived. No new replies allowed.