Steven ~
2011-05-31 17:47:31 UTC
(Laugh at my noobness, idc)
In my solution, I have 2 projects (Login Server and Common) (I'm messing around with an old source)
in Login Server I have main.cpp and main.h.
main.h is empty and main.cpp has the following
#include
#include "..\common\showmsg.h"
int main(int argc, char *argv[]) {
ShowMessage();
std::cin.get();
}
in Common i have showmsg.h and showmsg.cpp
showmsg.h has the following
#ifndef _SHOWMSG_H_
#define _SHOWMSG_H_
extern void ShowMessage();
#endif
showmsg.cpp has the following
#include
#include "showmsg.h"
void ShowMessage() {
printf("Hello");
}
The whole error is
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl ShowMessage(void)" (?ShowMessage@@YAXXZ) referenced in function _main
1>C:\Users\XXXX\Desktop\XXXX\XXXX\Debug\Login Server.exe : fatal error LNK1120: 1 unresolved externals