Re: [rt.cpan.org #55660] [PATCH] Partial win64 support for Win32::API

[email protected] ("Sisyphus")
Newsgroups perl.libwin32
Message-ID <AB79DD0D21D64872B899EFA7B85AA190@desktop2>
----- Original Message ----- 
From: "Sisyphus" <[email protected]>

> In any case, I'll try to rebuild the API_test64.dll when I get the time - 
> as that will probably fix the problem, irrespective of the cause. (I'll 
> get back when I've tested that out.)

Yes, I think that fixes the problem. The only test script that now fails is 
01_Struct.t.

I built the API_test64.dll manually by running:

cl -c API_test.cpp
cl /LD API_test.obj API_test.def bufferoverflowU.lib
I then renamed the API_test.dll that was produced, to API_test64.dll.

For that to work, in API_test.h, I had to first change:

#ifdef API_TEST_EXPORTS
#define API_TEST_API  __declspec(dllexport)
#else
#define API_TEST_API  __declspec(dllimport)
#endif

to:

#ifdef API_TEST_EXPORTS
#define API_TEST_API  /* __declspec(dllexport) */
#else
#define API_TEST_API  /* __declspec(dllimport) */
#endif

Otherwise, when trying to compile the obj file, I got errors of the type:

API_test.cpp(31) : error C2491: 'nAPI_test' : definition of dllimport data 
not allowed
API_test.cpp(33) : error C2491: 'sum_integers' : definition of dllimport 
function not allowed
API_test.cpp(37) : error C2491: 'sum_integers_ref' : definition of dllimport 
function not allowed
[and more similar]

I suspect that we need to build the API_test64.dll as part of the Win32::API 
build procedure (rather than supply a pre-built API_test64.dll).

Cheers,
Rob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.