Hi,

Looked at Perl 5.12.1 and that has following in CORE\Win32.h

#ifndef _WIN32_WINNT
#  define _WIN32_WINNT 0x0400
#endif

In compilers that support windows versions below XP, the CreateJobObject 
definition will be wrapped in a

#if _WIN32_WINNT >= 0x0500
....
#endif

block.

So, I think you need an explicit

#define _WIN32_WINNT 0x0501

and all should be OK


I would imagine you don't see the problem with mingw-w64 32 bit compiler 
as that just does not support below 0x501 so there's no ifdef around the 
declaration.

Regards

Mark


On 11/03/2012 06:01, Sisyphus wrote:
> Hi,
>
> This is a win32-perl issue, but not specifically an *ActivePerl* issue.
>
> For the demo, consider this Inline::C script:
>
> ###############################
> use strict;
> use Inline C => Config =>
> LIBS => '-lkernel32',
> BUILD_NOISY => 1;
> use Inline C => <<'END_C';
>
> #include <windows.h>
>
> void foo( char *name ) {
> int job;
> job = CreateJobObjectA( NULL, name );
> }
>
> END_C
>
> foo( 'fred' );
> ###############################
>
> With perl-5.14.0 and the mingw port of gcc-4.5.2 there's no problem.
> (See attached 'ok.txt'.)
> With perl-5.12.0 and the *same* compiler, CreateJobObjectA doesn't get
> found, even though it's defined in libkernel32.a (to which we are linking).
> (See attached 'out.txt'.)
>
> It's not a mingw-specific problem because I have a perl 5.10.0 that I
> built using MSVC++ 7.0, and the same problem occurs there (see outVC7.txt).
> With Microsoft Compilers only (even on a perl/compiler combo that
> works), we additionally get the warning:
>
> warning C4013: 'CreateJobObjectA' undefined; assuming extern returning int
>
> Why does that happen ?
>
> Generally, there's no problem with Inline::C and Windows API functions -
> but the "Job" related functions (such as CreateObjectA,
> SetInformationJobObject and AssignProcessToJobObject) just don't get
> found with some perl/compiler combos.
> (Btw, I haven't been able to re-create the failure on any of my x64
> builds.)
>
> Any ideas as to what might be screwing things up ? (I've spent hours
> comparing outputs of working and non-working builds of the script, and
> haven't been able to spot the crucial difference.)
>
> Cheers,
> Rob
>
>
> _______________________________________________
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to