Hey guys, I am trying to execute method, which is in another class, from main. I got all three classes in header file. When running program it says :
Error 2 error LNK1120: 1 unresolved externals D:\Year 2\Semester 2\C++\Exercises\ArraySearch\Debug\ArraySearch.exe 1 1 ArraySearch
AND
Error 1 error LNK2019: unresolved external symbol "public: void __thiscall array::print(void)" (?print@array@@QAEXXZ) referenced in function _main D:\Year 2\Semester 2\C++\Exercises\ArraySearch\ArraySearch\arraytest.obj ArraySearch
I dont know what Im doing worng. Heres my code for array.cpp
Likewise with arraytest::main, although I don't see any reason for that class to exist at all. You should also probably avoid naming classes names which conflict with types in the std namespace (such as std::array) especially if you're going to put usingnamespace std; in header files. It would also be advisable not to put using directives such as that in header files.