We are using Visual Studio 2010, the CLASS.cpp is included in the project. Is there something in the project properties that is causing this, perhaps something we need to add or modify?
The capital letters was just as an example. The actual code has a lot of meaningless things in it, and I'm just trying to focus on the problem at hand, not everything else.
Also, sorry for the late response, fell asleep at the monitor.
cire, Yes, my solution explorer looks exactly like that (of course, altered appropriately). P.S. Titling the project as 'Junk' made for a good chuckle around the project staff. Thank you :)
Mutexe, yes I have.
For the sake of showing the problem, I'm adding this:
Grid.h
1 2 3 4 5
class Grid{
public:
int DEMO[5][5];
void RESET();
};
Grid.cpp
1 2 3 4 5 6 7 8
#include "Grid.h"
void Grid::RESET()
{
for (int a = 0; a < 5; a++)
for (int b = 0; b < 5; b++)
DEMO[a][b] = 0;
}
main.cpp
1 2 3 4 5 6 7
#include "Grid.h"
int main()
{
Grid Game;
Game.RESET();
}
Error:
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Grid::RESET(void)" (?RESET@Grid@@QAEXXZ) referenced in function _main
If you do something that generates an error in Grid.cpp, does it still compile and give that linker error? If so, that means it's not even compiling Grid.cpp
Simple test: put #error as the first line in Grid.cpp
P.S. Understand that I have the intelligence of a grapefruit, so if it's something so simple that you're not even suggesting it as a possible problem, please suggest it as a possible problem.
My only advice would be to try removing it from the project (not deleting it) and then re-add it (Add Existing File) to see if that resets any broken settings.
that example is compiling fine for me, so it's either down to project settings like LB suggested, or your supplied example code isn't a 100% reflection of your actual code.
L B, your plan worked. I excluded all files, headers included, from the project. I then added them all back in, and it linked them! Thank you very much!