I am working with a precompiled library (.lib) that I wrote in Visual Studio 2010. My solution has two projects. The first project (C) builds the library. The second project (C++) is a Win32 console application that is intended to test the library. Everything I've tried does not resolve the linker errors. (I thought this would be easy because everything is in the same solution.) Any pointers would be appreciated. Thanks.
Here is the linker error that I am getting:
1>MyProject.obj : error LNK2019: unresolved external symbol "void __cdecl my_function(void)" (?my_function@@YAXXZ) referenced in function _wmain
1>C:\Documents and Settings\user\Desktop\MySolution\Debug\MyProject.exe : fatal error LNK1120: 1 unresolved externals
This is the code for the Win32 console application:
#include "stdafx.h"
#include "my_api.h"
int _tmain(int argc, _TCHAR* argv[])
{
my_function();
return 0;
}
Here's how my_function is declared in my_api.h:
extern VOID my_function(VOID);