View mode: basic / threaded / horizontal-split · Log in · Help
November 11, 2012
Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
I'm not sure if this is the correct forum. But It looks like I'm 
one of the few people that ran into this. I've recently upgraded 
to 2.60 and been getting this error when compiling:

Error: undefined identifier 
WIN32_FILE_ATTRIBUTE_DATA	D:\__dev\D\dmd2\src\phobos\std\file.d	530	

Now I have found the thread of Walter at 
http://www.digitalmars.com/d/archives/digitalmars/D/announce/D_version_of_MicroEmacs_24416.html 
, but it didn't help me much to solving my problem. Does anyone 
have an idea how I can fix this :-S

Thank you
November 11, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
On Sun, 11 Nov 2012 08:03:40 -0000, creatio <creatio.x.14@gmail.com> wrote:

>
> I'm not sure if this is the correct forum. But It looks like I'm one of  
> the few people that ran into this. I've recently upgraded to 2.60 and  
> been getting this error when compiling:
>
> Error: undefined identifier  
> WIN32_FILE_ATTRIBUTE_DATA	D:\__dev\D\dmd2\src\phobos\std\file.d	530	
>
> Now I have found the thread of Walter at  
> http://www.digitalmars.com/d/archives/digitalmars/D/announce/D_version_of_MicroEmacs_24416.html  
> , but it didn't help me much to solving my problem. Does anyone have an  
> idea how I can fix this :-S

Try to reduce your code down to a sample which fails and post it here.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
November 12, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
Dne 11.11.2012 21:41, Regan Heath napsal(a):
> On Sun, 11 Nov 2012 08:03:40 -0000, creatio <creatio.x.14@gmail.com> wrote:
>
>>
>> I'm not sure if this is the correct forum. But It looks like I'm one
>> of the few people that ran into this. I've recently upgraded to 2.60
>> and been getting this error when compiling:
>>
>> Error: undefined identifier WIN32_FILE_ATTRIBUTE_DATA
>> D:\__dev\D\dmd2\src\phobos\std\file.d    530
>>
>> Now I have found the thread of Walter at
>> http://www.digitalmars.com/d/archives/digitalmars/D/announce/D_version_of_MicroEmacs_24416.html
>> , but it didn't help me much to solving my problem. Does anyone have
>> an idea how I can fix this :-S
>
> Try to reduce your code down to a sample which fails and post it here.
>
> R

Hi Regan,

rdmd --eval="import std.file;" --main

Environment: DMD32 D Compiler v2.060, Windows 7 Pro 32bit

Martin
November 13, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
On Mon, 12 Nov 2012 21:22:16 -0000, Martin Drašar <drasar@ics.muni.cz>  
wrote:

> Dne 11.11.2012 21:41, Regan Heath napsal(a):
>> On Sun, 11 Nov 2012 08:03:40 -0000, creatio <creatio.x.14@gmail.com>  
>> wrote:
>>
>>>
>>> I'm not sure if this is the correct forum. But It looks like I'm one
>>> of the few people that ran into this. I've recently upgraded to 2.60
>>> and been getting this error when compiling:
>>>
>>> Error: undefined identifier WIN32_FILE_ATTRIBUTE_DATA
>>> D:\__dev\D\dmd2\src\phobos\std\file.d    530
>>>
>>> Now I have found the thread of Walter at
>>> http://www.digitalmars.com/d/archives/digitalmars/D/announce/D_version_of_MicroEmacs_24416.html
>>> , but it didn't help me much to solving my problem. Does anyone have
>>> an idea how I can fix this :-S
>>
>> Try to reduce your code down to a sample which fails and post it here.
>>
>> R
>
> Hi Regan,
>
> rdmd --eval="import std.file;" --main
>
> Environment: DMD32 D Compiler v2.060, Windows 7 Pro 32bit

I get no errors, in fact I get no output at all from that command line.

Environment: DMD32 D Compiler v2.060, Windows 7 Pro 64bit

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
November 13, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
On 13.11.2012 12:41, Regan Heath wrote:
>> Hi Regan,
>>
>> rdmd --eval="import std.file;" --main
>>
>> Environment: DMD32 D Compiler v2.060, Windows 7 Pro 32bit
> 
> I get no errors, in fact I get no output at all from that command line.
> 
> Environment: DMD32 D Compiler v2.060, Windows 7 Pro 64bit
> 
> R

Hmm,

that is might strange. I have just downloaded D installer from the
website, installed it on Windows 7 Pro 64bit and ran the command and
this is what I got:

> std.cpuid has been deprecated. It will be removed in January 2013. Please use co
> re.cpuid instead.
> C:\Program Files\D\dmd2\windows\bin\..\..\src\phobos\std\file.d(530): Error: und
> efined identifier WIN32_FILE_ATTRIBUTE_DATA

Which is exactly the same error I have on 32bit machine.

Martin
November 13, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
On Tue, 13 Nov 2012 12:21:06 -0000, Martin Drasar <drasar@ics.muni.cz>  
wrote:

> On 13.11.2012 12:41, Regan Heath wrote:
>>> Hi Regan,
>>>
>>> rdmd --eval="import std.file;" --main
>>>
>>> Environment: DMD32 D Compiler v2.060, Windows 7 Pro 32bit
>>
>> I get no errors, in fact I get no output at all from that command line.
>>
>> Environment: DMD32 D Compiler v2.060, Windows 7 Pro 64bit
>>
>> R
>
> Hmm,
>
> that is might strange. I have just downloaded D installer from the
> website, installed it on Windows 7 Pro 64bit and ran the command and
> this is what I got:
>
>> std.cpuid has been deprecated. It will be removed in January 2013.  
>> Please use co
>> re.cpuid instead.
>> C:\Program Files\D\dmd2\windows\bin\..\..\src\phobos\std\file.d(530):  
>> Error: und
>> efined identifier WIN32_FILE_ATTRIBUTE_DATA
>
> Which is exactly the same error I have on 32bit machine.

Curiouser and curiouser.  In my case I had (re)built phobos/druntime so,  
suspecting it might be causing issues I download a fresh copy of the  
installer, moved my old installation folder and replaced it with the new  
one.

I still don't get any output/errors.

If I add --force to the command line given, I get the std.cpuid  
deprecation warning, but no other output.

I stripped my PATH right back to just about nothing and that made no  
difference.

Can you get the same errors running dmd directly?  I can't seem to get it  
to output the deprecation message..

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
November 13, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
On 13.11.2012 15:00, Regan Heath wrote:

> Curiouser and curiouser.  In my case I had (re)built phobos/druntime so,
> suspecting it might be causing issues I download a fresh copy of the
> installer, moved my old installation folder and replaced it with the new
> one.
> 
> I still don't get any output/errors.
> 
> If I add --force to the command line given, I get the std.cpuid
> deprecation warning, but no other output.
> 
> I stripped my PATH right back to just about nothing and that made no
> difference.
> 
> Can you get the same errors running dmd directly?  I can't seem to get
> it to output the deprecation message..
> 
> R
> 

Odd...

When running the dmd directly I only get the WIN32_FILE_ATTRIBUTE_DATA
error, not the deprecation message. I have posted the rdmd command,
because it was a bit shorter and easier to test than the dmd.

This is my sc.ini if it helps anything:
[Version]
version=7.51 Build 020

[Environment]
LIB="%@P%\..\lib";\dm\lib
DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import"
LINKCMD=%@P%\link.exe

Martin
November 13, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
On Tue, 13 Nov 2012 15:37:54 -0000, Martin Drasar <drasar@ics.muni.cz>  
wrote:

> On 13.11.2012 15:00, Regan Heath wrote:
>
>> Curiouser and curiouser.  In my case I had (re)built phobos/druntime so,
>> suspecting it might be causing issues I download a fresh copy of the
>> installer, moved my old installation folder and replaced it with the new
>> one.
>>
>> I still don't get any output/errors.
>>
>> If I add --force to the command line given, I get the std.cpuid
>> deprecation warning, but no other output.
>>
>> I stripped my PATH right back to just about nothing and that made no
>> difference.
>>
>> Can you get the same errors running dmd directly?  I can't seem to get
>> it to output the deprecation message..
>>
>> R
>>
>
> Odd...
>
> When running the dmd directly I only get the WIN32_FILE_ATTRIBUTE_DATA
> error, not the deprecation message. I have posted the rdmd command,
> because it was a bit shorter and easier to test than the dmd.
>
> This is my sc.ini if it helps anything:
> [Version]
> version=7.51 Build 020
>
> [Environment]
> LIB="%@P%\..\lib";\dm\lib
> DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import"
> LINKCMD=%@P%\link.exe

Mine is the same (default, no modifications).  I have added the dmd.exe  
path to PATH and I rely on the relative path references in the default  
sc.ini to find everything else.

Looking at the rdmd source I realised it was creating files in  
%TEMP%\.rdmd and in there I found the source it was compiling:

module temporary;
import std.stdio, std.algorithm, std.array, std.ascii, std.base64,
    std.bigint, std.bitmanip,
    std.compiler, std.complex, std.concurrency, std.container, std.conv,
    std.cpuid, std.cstream, std.csv,
    std.datetime, std.demangle, std.encoding, std.exception,
    std.file,
    std.format, std.functional, std.getopt, std.json,
    std.math, std.mathspecial, std.md5, std.metastrings, std.mmfile,
    std.numeric, std.outbuffer, std.parallelism, std.path, std.process,
    std.random, std.range, std.regex, std.signals, std.socket,
    std.socketstream, std.stdint, std.stdio, std.stdiobase, std.stream,
    std.string, std.syserror, std.system, std.traits, std.typecons,
    std.typetuple, std.uni, std.uri, std.utf, std.variant, std.xml,  
std.zip,
    std.zlib;
void main(char[][] args) {
import std.file;;
}

I suspect the reason you only see the deprecation message with rdmd is the  
import of "std.cpuid" in the above.  So, I believe that is one mystery  
solved but the main problem still isn't a problem on my machine for some  
reason.

Does your dmd2\src\druntime\import\core\sys\windows\windows.d file have a  
definition of WIN32_FILE_ATTRIBUTE_DATA on line 448?

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
November 13, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
Dne 13.11.2012 17:44, Regan Heath napsal(a):
> I suspect the reason you only see the deprecation message with rdmd is
> the import of "std.cpuid" in the above.  So, I believe that is one
> mystery solved but the main problem still isn't a problem on my machine
> for some reason.

Good... one down, one left.

> Does your dmd2\src\druntime\import\core\sys\windows\windows.d file have
> a definition of WIN32_FILE_ATTRIBUTE_DATA on line 448?

Yup, it is there.

struct WIN32_FILE_ATTRIBUTE_DATA
{
    DWORD    dwFileAttributes;
    FILETIME ftCreationTime;
    FILETIME ftLastAccessTime;
    FILETIME ftLastWriteTime;
    DWORD    nFileSizeHigh;
    DWORD    nFileSizeLow;
}
alias WIN32_FILE_ATTRIBUTE_DATA* LPWIN32_FILE_ATTRIBUTE_DATA;

The most annoying thing is that when you look at the std.file source, 
you see that 'public import core.sys.windows.windows' and if you click 
on 'Go to definition' in Visual studio it takes you right to windows.d 
file with that WIN32_FILE_ATTRIBUTE_DATA struct defined...

Martin
November 14, 2012
Re: Undefined identifier WIN32_FILE_ATTRIBUTE_DATA
On Tue, 13 Nov 2012 22:52:42 -0000, Martin Drašar <drasar@ics.muni.cz>  
wrote:

> Dne 13.11.2012 17:44, Regan Heath napsal(a):
>> Does your dmd2\src\druntime\import\core\sys\windows\windows.d file have
>> a definition of WIN32_FILE_ATTRIBUTE_DATA on line 448?
>
> Yup, it is there.
>
> struct WIN32_FILE_ATTRIBUTE_DATA
> {
>      DWORD    dwFileAttributes;
>      FILETIME ftCreationTime;
>      FILETIME ftLastAccessTime;
>      FILETIME ftLastWriteTime;
>      DWORD    nFileSizeHigh;
>      DWORD    nFileSizeLow;
> }
> alias  * LPWIN32_FILE_ATTRIBUTE_DATA;
>
> The most annoying thing is that when you look at the std.file source,  
> you see that 'public import core.sys.windows.windows' and if you click  
> on 'Go to definition' in Visual studio it takes you right to windows.d  
> file with that WIN32_FILE_ATTRIBUTE_DATA struct defined...

Well.. druntime is built into a lib, and phobos is built using that lib.   
So, the only way I can imagine reproducing this error is by altering  
dmd2\src\druntime\import\core\sys\windows\windows.d, rebuilding druntime,  
then rebuilding phobos and replacing the phobos.lib in dmd2\windows\lib.

BUT, doing so fails at the rebuild of phobos, giving the error:
std\file.d(530): Error: undefined identifier WIN32_FILE_ATTRIBUTE_DATA,  
did you mean struct xxWIN32_FILE_ATTRIBUTE_DATA?

So.. it's almost like in your case the rdmd/dmd command line is not using  
the pre-built phobos.lib, but trying to recompile std.file itself.

I assume you have a dmd2\windows\lib\phobos.lib?  What are the dates on  
various files.. is it possible you are time shifted in such a way which is  
confusing the compiler into ignoring phobos.lib and rebuilding from source?

What happens if you run dumpobj (dmc\dm\bin) on phobos.lib, .e.g
  dumpobj -p phobos.lib > output.txt

then open output.txt and look for WIN32_FILE_ATTRIBUTE_DATA.  Bear in mind  
the output wraps the symbol names as needed so simply searching for  
"WIN32_FILE_ATTRIBUTE_DATA" wont find anything.

Searching for "WIN" and filtering manually I found:

81499  PUB386  1  4 3e 5f 44 34 63 6f 72 65 33 73 79 73 37 77    
..>_D4core3sys7w
             69 6e 64 6f 77 73 37 77 69 6e 64 6f 77 73 32 35    
indows7windows25
             57 49 4e 33 32 5f 46 49 4c 45 5f 41 54 54 52 49    
WIN32_FILE_ATTRI
             42 55 54 45 5f 44 41 54 41 36 5f 5f 69 6e 69 74    
BUTE_DATA6__init
             5a  0  0  0  0  0                                 Z.....

87599  LNAMES 4a 5f 44 36 32 54 79 70 65 49 6e 66 6f 5f 53 34    
J_D62TypeInfo_S4
             63 6f 72 65 33 73 79 73 37 77 69 6e 64 6f 77 73    
core3sys7windows
             37 77 69 6e 64 6f 77 73 32 35 57 49 4e 33 32 5f    
7windows25WIN32_
             46 49 4c 45 5f 41 54 54 52 49 42 55 54 45 5f 44    
FILE_ATTRIBUTE_D
             41 54 41 36 5f 5f 69 6e 69 74 5a                  ATA6__initZ

8776f  CMD386  0 10  0  0  0  0  0  0  1  2  a  0  0  0  0  0    
................
              0  0  0 32  0  0  0 3c  0  0  0 24  0  0  0  0    
...2...<...$....
              0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0    
................
              0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  4    
................
              0  0  0  0  0  0  0 63 6f 72 65 2e 73 79 73 2e    
.......core.sys.
             77 69 6e 64 6f 77 73 2e 77 69 6e 64 6f 77 73 2e    
windows.windows.
             57 49 4e 33 32 5f 46 49 4c 45 5f 41 54 54 52 49    
WIN32_FILE_ATTRI
             42 55 54 45 5f 44 41 54 41  0                     BUTE_DATA.

1bba05  LNAMES 5b 5f 44 33 73 74 64 34 66 69 6c 65 32 30 67 65    
[_D3std4file20ge
             74 46 69 6c 65 41 74 74 72 69 62 75 74 65 73 57    
tFileAttributesW
             69 6e 46 78 41 61 5a 53 34 63 6f 72 65 33 73 79    
inFxAaZS4core3sy
             73 37 77 69 6e 64 6f 77 73 37 77 69 6e 64 6f 77    
s7windows7window
             73 32 35 57 49 4e 33 32 5f 46 49 4c 45 5f 41 54    
s25WIN32_FILE_AT
             54 52 49 42 55 54 45 5f 44 41 54 41               TRIBUTE_DATA

1bba6b  LNAMES 7a 5f 44 33 73 74 64 34 66 69 6c 65 32 30 67 65    
z_D3std4file20ge
             74 46 80 83 89 41 74 74 72 69 62 75 74 65 73 57    
tF...AttributesW
             69 6e 46 78 41 61 5a 53 34 63 6f 72 65 33 73 79    
inFxAaZS4core3sy
             73 37 77 69 6e 64 6f 77 ff 73 32 35 57 49 4e 33    
s7window.s25WIN3
             32 5f 46 49 4c 45 5f 41 54 54 52 49 42 55 54 45    
2_FILE_ATTRIBUTE
             5f 44 41 54 41 31 35 5f 5f 64 67 6c 69 74 65 72    
_DATA15__dgliter
             61 6c 32 32 36 38 4d 46 5a 43 36 6f 62 6a 65 63    
al2268MFZC6objec
             74 39 54 68 72 6f 77 61 62 6c 65                  t9Throwable

1bc1f1  EXTDEF 5b 5f 44 33 73 74 64 34 66 69 6c 65 32 30 67 65    
[_D3std4file20ge
             74 46 69 6c 65 41 74 74 72 69 62 75 74 65 73 57    
tFileAttributesW
             69 6e 46 78 41 61 5a 53 34 63 6f 72 65 33 73 79    
inFxAaZS4core3sy
             73 37 77 69 6e 64 6f 77 73 37 77 69 6e 64 6f 77    
s7windows7window
             73 32 35 57 49 4e 33 32 5f 46 49 4c 45 5f 41 54    
s25WIN32_FILE_AT
             54 52 49 42 55 54 45 5f 44 41 54 41  0             
TRIBUTE_DATA.

1bc58c  EXTDEF 5b 5f 44 33 73 74 64 34 66 69 6c 65 32 30 67 65    
[_D3std4file20ge
             74 46 69 6c 65 41 74 74 72 69 62 75 74 65 73 57    
tFileAttributesW
             69 6e 46 78 41 61 5a 53 34 63 6f 72 65 33 73 79    
inFxAaZS4core3sy
             73 37 77 69 6e 64 6f 77 73 37 77 69 6e 64 6f 77    
s7windows7window
             73 32 35 57 49 4e 33 32 5f 46 49 4c 45 5f 41 54    
s25WIN32_FILE_AT
             54 52 49 42 55 54 45 5f 44 41 54 41  0             
TRIBUTE_DATA.

1bf00e  EXTDEF 17 5f 44 31 31 54 79 70 65 49 6e 66 6f 5f 41 61    
._D11TypeInfo_Aa
             36 5f 5f 69 6e 69 74 5a  0 5b 5f 44 33 73 74 64    
6__initZ.[_D3std
             34 66 69 6c 65 32 30 67 65 74 46 69 6c 65 41 74    
4file20getFileAt
             74 72 69 62 75 74 65 73 57 69 6e 46 78 41 61 5a    
tributesWinFxAaZ
             53 34 63 6f 72 65 33 73 79 73 37 77 69 6e 64 6f    
S4core3sys7windo
             77 73 37 77 69 6e 64 6f 77 73 32 35 57 49 4e 33    
ws7windows25WIN3
             32 5f 46 49 4c 45 5f 41 54 54 52 49 42 55 54 45    
2_FILE_ATTRIBUTE
             5f 44 41 54 41  0                                 _DATA.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home