Build C++ files: .h and .cpp -
We are trying to find out how to create a C ++ file with .h and .cpp files. We are getting the same error: Error LNK2019: Unsolved exotic symbol is referred to in WinMain @ 16 function _ _tmainCRTStartup, and we do not know what we're doing wrong code from our 3 files here Has been:
// First CPP file #include "stdafx.h" #include & lt; Iostream & gt; # Included "chayaGradeBook.h.h" name std; // Constructor Gradebook :: Gradebook (name of string) {setCourseName (name); } Zero gradebook :: setcarsname (string name) {if (name.size () 25) {courseName = name.substr (0, 25); Serie Lieutenant; & Lt; "Name \" "
// chayaGradeBook.h.h #include & lt; String & gt; // Grade Book Category Definition Class Gradebook {Public: Clear Gradebook (std :: string); Zero set job name (standard :: string); Std :: string getCourseName () console; Zero display message (); CONST; Private: std :: string courseName; };
Main.cpp file:
#include "stdafx.h" # Include & lt; Iostream & gt; #include "chaaGradeBook.h.h" #include "chayaGradeBook.cpp" using namespace std; Int main () {Gradebook Gradebook 1 ("Introduction to CS101 Programming C ++"); Gradebook Gradebook 2 ("CS102 Data Structures"); The court's & lt; & Lt; "Gradebook 1's initial course name is:" & lt; & Lt; GradeBook1.getCourseName () & lt; & Lt; "\ NThe name of the bookBook2 is the default name:" & lt; & Lt; Gradebook2.getCourseName () & lt; & Lt; Endl; GradeBook1.setCourseName ("CS101 C ++ Programming"); Cout & lt; & Lt; "Course Name of the upgradebook1 is:" & lt; & Lt; Gradebook1.getCourseName () & lt; & Lt; "The course name of \ NBookBook2 is:" & lt; & Lt; Gradebook 2.getCOurseName () & lt; & Lt; Endl; }
Comments
Post a Comment