G
Guest
Hello
I have created what you would think would be the simplest of static
libraries, and still I cannot get it to link correctly.
In the static library (main.c) I have:
long __cdecl getnum(long testinput)
{
return 42;
}
and in the console app I have to test it, I have:
extern long __cdecl getnum(long testinput);
long _tmain(long argc, _TCHAR* argv[])
{
printf("number is %d", getnum(7));
}
I have the output .lib file of the first project added to the additional
linker dependencies in project properties, and the static library project's
output folder in the additional include directories for the test project.
Yet I get the error
libtest.obj : error LNK2019: unresolved external symbol "long __cdecl
getnum(long)" (?getnum@@YAJJ@Z) referenced in function _main
Debug/libtest.exe : fatal error LNK1120: 1 unresolved externals
I have created what you would think would be the simplest of static
libraries, and still I cannot get it to link correctly.
In the static library (main.c) I have:
long __cdecl getnum(long testinput)
{
return 42;
}
and in the console app I have to test it, I have:
extern long __cdecl getnum(long testinput);
long _tmain(long argc, _TCHAR* argv[])
{
printf("number is %d", getnum(7));
}
I have the output .lib file of the first project added to the additional
linker dependencies in project properties, and the static library project's
output folder in the additional include directories for the test project.
Yet I get the error
libtest.obj : error LNK2019: unresolved external symbol "long __cdecl
getnum(long)" (?getnum@@YAJJ@Z) referenced in function _main
Debug/libtest.exe : fatal error LNK1120: 1 unresolved externals