I got a executable program from my former colleague who has left my company.
Its main function looks like this:
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int nRetCode = 5;
SL_Begin_Process(__argc,__argv, NULL, "Customer_Test", "");
......
}
In this program, it uses C and Fortran code. When I compiled this program
in Debug mode, I got the following error:
Customer_Test.obj : error LNK2001: unresolved external symbol ___argc
Customer_Test.obj : error LNK2001: unresolved external symbol ___argv
Debug/Customer_Test.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
My question is why these errors occured? In a C program, argc and argv is
defined in the main function like
int main(int argc, char *argv[]){}. However, I can not find where __argc
and __argv are defined. If I compiled in Release mode, it compiles
successfully without such error.
Any of your help is greatly appreciated.
Tony