Why vc++ link can not find function which is built in the same project?
Hi there,
When I try to build the executable, the error is as the following:
iis.obj : error LNK2001: unresolved external symbol "int __cdecl lm(int,char *)" (?lm@@YAHHPAD@Z)
Debug/iis.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
The function is defined in the file buildd.c
Code:
//buildd.c
#include <stdio.h>
#include "buildd.h"
int __cdecl lm(int i,char * filename)
{
return i + strlen(filename);
}
file buildd.h
#include "StdAfx.h"
int __cdecl lm(int i,char * filename);
and in iis.cpp, the code invoking the function lm is located in the body of int APIENTRY WinMain, which is:
inm = lm(10,ryDict);
Why the vc++ link can not find the function lm, which is built in the same project?
Thanks,