I have to c/c++ projects - one a static library and the other is on exe. I have a header file visible to both with this declaration
void SendChar(void);
I implement this in the static library
#include "USART.h"
#include <stdio.h>
void SendChar(void)
{
printf("SendChar\n");
}
And use it in the exe
#include "USART.h"
extern void SendChar();
int main()
{
std::cout << "Hello World!\n";
SendChar();
}
I get a linker error and I dont understand why
1>EncoderApp.obj : error LNK2019: unresolved external symbol "void __cdecl SendChar(void)" (?SendChar@@YAXXZ) referenced in function _main
1>C:\Users\Graham.Labdon\Documents\IPCSolution\Debug\EncoderApp.exe : fatal error LNK1120: 1 unresolved externals
Please can someone explain this