Boreland - Linking Error

This is a discussion on Boreland - Linking Error within the C++ Programming forums, part of the General Programming Boards category; I am using Boreland 5.02 and am having difficulty compiling and linking a project. This is the first time I ...

Boreland - Linking Error

I am using Boreland 5.02 and am having difficulty compiling and linking a project. This is the first time I am trying this, prior to this all my programming was done in one .c file. I have only written in c so far, no c++.

I have 3 .cpp files and 2 header files in my project, the programs compile ok, but I receive an error when it tries to link. The files I have came from my instructor, who uses microsoft visual C++.

Here is the output when I try to compile and link the code. The last section is what is giving me trouble, the errrors are at the bottom. I have also included the .cpp and .h files below, there is not much to them, just the beginning of a program. but it does compile and link for my instructor.

I suspect you are getting blindsided by compiler incompatability. Some compilers are more pickiunish than others.

Firt, Borland 5.02 may not have STL in it and may not be namespace compliant. If you know for sure that it is, fine, but that can cause some of your errors.

Second, I suggest you always be sure the header files are compiled before the pertinent .cpp files.

Third, I think console programs use a default argc and argv meaning they can't be specified. I believe only true DOS programs can use command line arguments. Console programs are not true DOS programs.

Fourth you can only have one main() function per program. No
cpp file brought in by an included file should have a main() function in it. (see your account.cpp and your atm.cpp)

Here's a brief outline for your program:

Driver file---atm--- where the one and only main() is.
includes are iostream, account.h, and error.h.