Hi guys!

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????
How can i link those files and where to execute the application

Thank you

Recommended Answers

All 5 Replies

What's the exact error?

unresolved external symbol "public: __thiscall GradeBook::GradeBook(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0GradeBook@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main

its an unsolved external complaining about one of the member functions in my .cpp file

Have you included the necessary header files (I presume the file in which GradeBook is defined) in the main cpp file?
Maybe you could post up some code for people to look at? It will make the analysis of your problem much easier

Are you missing the include header directive in both of your CPP files? It looks something like this:

#include "GradeBook.h"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.