News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Struct help!

Started by Artoo, April 28, 2005, 11:04:05 AM

Previous topic - Next topic

Artoo

Hello All!

Can someone please help me regarding struct!

I have:

mystruct STRUCT
  mypoint    POINT     <?,?>
  data1      DWORD      ?
  data2      DWORD      ?
mystruct ENDS


but the assembler reports an error:

error A2163: non-benign structure redefinition: incorrect initializers : mystruct

The assembler marked the 'mypoint' as the culprit!  :(

Does anyone have any ideas??



Tedd

It treats a structure as a single item, so you only need one '?'


mystruct STRUCT
  mypoint    POINT     <?>
  data1      DWORD      ?
  data2      DWORD      ?
mystruct ENDS
No snowflake in an avalanche feels responsible.

Artoo

I tried that...but it gives the same error?

Jimg

should be without the ?, just
mypoint POINT <>

wizzra


.386
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

.data?
mystruct STRUC
  mypoint    POINT     <?,?>
  data1      DWORD      ?
  data2      DWORD      ?
mystruct ENDS

.code
start:     
     
end start



no prob on assembling it here ...

QvasiModo

Apparently you have more than one definition of mystruct, with different meanings (that's the "non-benign" part, MASM tolerates multiple definitions as long as they're identical).

BTW, these lines do the exact same thing:

mypoint POINT <>
mypoint POINT <?,?>

pbrennick

Artoo,
Search your program source and its dependencies for another occurrence of mypoint.  If you have trouble finding it, slightly alter it in the structure and also whereever it is used in your source and the problem will disappear.  You could capitalize the 'm' for instance.  Just make sure you modify all occurrences of 'mypoint' in your source.

Paul

Artoo

Thanks for all your replies....

I had tried all the changes you suggested already. Before I even posted the original.

I have an inkling that it might be todo with where its declared. eg .data?

I have it declared in an INC file that I include from my main asm file. I dont think <trying to remember my code> the inc file has .data?

Would this be the issue?

I cant try it now as I am at work. 

Thanks again.