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()?!?

Re: warning C4013: 'GetComputerNameEx' undefined by Brian

Brian
Wed Jul 19 18:25:26 CDT 2006

#include <windows.h>

Brian



Re: warning C4013: 'GetComputerNameEx' undefined by iameug

iameug
Thu Jul 20 09:32:25 CDT 2006

I already have

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <tchar.h>



Brian Muth wrote:
> #include <windows.h>
>
> Brian


Re: warning C4013: 'GetComputerNameEx' undefined by Igor

Igor
Thu Jul 20 10:02:55 CDT 2006

iameug <iameug@yahoo.com> wrote:
> Brian Muth wrote:
>> #include <windows.h>
>
> I already have
>
> #include <windows.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <tchar.h>

You're probably going to hate me for asking the obvious, but do you have
those defines you mention in your first post _before_ #include
<windows.h> ?
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925