Feb 21, 2011 at 1:57am UTC
Hi,
Could anyone help me understand these errors please!!
It complies fine, but build failed :(
1>matrix.obj : error LNK2019: unresolved external symbol "public: __thiscall matrixClass::matrixClass(void)" (??0matrixClass@@QAE@XZ) referenced in function "class matrixClass __cdecl operator+(class matrixClass const &,class matrixClass const &)" (??H@YA?AVmatrixClass@@ABV0@0@Z)
1>program3.obj : error LNK2001: unresolved external symbol "public: __thiscall matrixClass::matrixClass(void)" (??0matrixClass@@QAE@XZ)
1>C:\Documents and Settings\Mostafa\my documents\visual studio 2010\Projects\program3\Debug\program3.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
Thanks
Feb 21, 2011 at 2:11am UTC
It's likely you have prototypes for your matrixClass constructor and your global operator+() but haven't linked in the source file with the implementation inside.
Feb 21, 2011 at 4:48am UTC
I am still confused. SO, what should I do to erase these errors!!
Do I have to copy my code here??
Feb 21, 2011 at 5:08am UTC
You need to link your source files. How are you building your project? An IDE?
Feb 21, 2011 at 5:22am UTC
Are you using an IDE? You need to tell your linker (or IDE, which will tell the linker) that all these source files need to go together. Usually this is done by making a "project" or something.
Feb 21, 2011 at 5:25am UTC
I don't know what an IDE is!!
so my code is corect I just need this "IDE"
Feb 21, 2011 at 6:16am UTC
How are you compiling your program? Visual Studio? Or something else?
Feb 21, 2011 at 6:34am UTC
Are all 3 files part of your project?
If not, go to Project | Add Existing Item and add them all. Then rebuild.
Feb 21, 2011 at 6:41am UTC
Yes they are all part of one project.