Click to See Complete Forum and Search --> : warning C4013: 'GetComputerNameEx' undefined


eug_prog
July 19th, 2006, 06:23 PM
Hello,

I have a simple C program that invokes GetComputerNameEx() with
'(COMPUTER_NAME_FORMAT)ComputerNameDnsFullyQualified' value as first parameter. During compilation (via cl.exe command line or as part of
VC 2003 project), I consistently get compile error (see "subject line"
above). That is happening despite the following definitions on my
WinXP system:


#ifdef WINVER
#undef WINVER
#endif
#define APPVER 5.0
#define WINVER 0x0501
#define _WIN32_WINNT WINVER

#ifndef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WINXPSP2
#endif


How can I compile a program that tries to use GetComputerNameEx()?!?

MrViggy
July 19th, 2006, 06:53 PM
Are these macros defined before you include "Windows.h"?

Viggy

Calculator
July 19th, 2006, 07:21 PM
You will probably need the latest PSDK also.

eug_prog
July 20th, 2006, 10:40 AM
MrViggy,

You were right.

I can't believe I have done something that stupid! This is even worse than solving a triple integral and making a mistake in arithmetic in the end...

Calculator,

By the way, I have the latest SDK, but thanks for pointing that out.


Thanks to all for feedback!

MrViggy
July 20th, 2006, 06:33 PM
Don't worry! It's always the little things that trip me up as well!

;)

Viggy