Can anyone help me? Im a new to this site and C++ environment.
Im running a Microsoft Visual C++ express 2010 and I write a code in 3 separate files. 1 of them is a header file with an extention .h. and 2 of them are .cpp files. I have defined function prototype in the header file and its implementation in .cpp file. Then i execute this code in "int main" function which i have defined into the 3rd separate file. And while compiling it shows a linker error. i think the problem is the location of those many files. How shall i place those files to make the main program execute????
If the link error is an unresolved external complaining about one of your functions
implemented in a .cpp file then you need to make sure you link both .o (.obj) files
into the executable, and not just one.
Thanks for attention! But I have copied all the files in one directory but still doesn't work. What do u mean by linking .o files??? Putting them into the same directory? or I have to "link" them inside the program?