Home > Software engineering >  If the compiler to ignore cannot resolve the external symbol?
If the compiler to ignore cannot resolve the external symbol?

Time:12-10

Such as in the following programs:

Int Max ();

Int main ()
{
If (0)
{
Max ();
}
return 0;
}

Max function is not defined clearly, but still the program will not call this function,
If compilation directly, will certainly to error "error LNK2001: cannot resolve the external symbol" int __cdecl Max (void) "", but in order to program do after extension here is not convenient to comment out directly, so could you please tell me the great spirit, is there any way to let the compiler doesn't offer this error? Or to ignore this error?
I remember a - using GCC compiler unresolved - symbols compiler options if you can ignore this error and wonder whether there is a similar function of VC,

CodePudding user response:

Then define an empty function Max () {}, not solve all the problems, why so?

CodePudding user response:

# define Max () __noop

CodePudding user response:

Written inline function
  • Related