I am just getting used C++ syntax and have constructed a very simple bit of code for testing:
I have the following files:
shoe.h (contains declaration for "TieLaces")
test.cpp (contains "main")
shoe.cpp (contains a function "TieLaces" which I make use of in "test.cpp")
Test.cpp and shoe.cpp are part of the same assembly (i.e., shoe.cpp is not part of an external library).
I am using MS VC++ 2008. It compiles fine, but the Linker section reports an "unresolved token" with regard to function "TieLaces".
I know that external libraries must be referenced in the Linker config section for external libs, but there is no way to reference an internal function (that I know of). So, why is this error occurring?
Shoe.cpp:
#include "stdafx.h"
#include "Shoe.h"
#define TRUE 1;
#define FALSE 0;
Shoe::Shoe() {}
Shoe::~Shoe() {}
bool TieLaces(void)
{
bool Done = TRUE;
return Done;
}
Test.cpp:
#include "stdafx.h"
#include "Shoe.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
Shoe newShoes;
newShoes.TieLaces();
return 0;
}
Shoe.h:
class Shoe
{
public:
Shoe();
~Shoe(void);
bool TieLaces(void);
};