The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Artoo on April 28, 2005, 11:04:05 AM

Title: Struct help!
Post by: Artoo on April 28, 2005, 11:04:05 AM
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??


Title: Re: Struct help!
Post by: Tedd on April 28, 2005, 11:29:01 AM
It treats a structure as a single item, so you only need one '?'


mystruct STRUCT
  mypoint    POINT     <?>
  data1      DWORD      ?
  data2      DWORD      ?
mystruct ENDS
Title: Re: Struct help!
Post by: Artoo on April 28, 2005, 01:30:09 PM
I tried that...but it gives the same error?
Title: Re: Struct help!
Post by: Jimg on April 28, 2005, 01:40:17 PM
should be without the ?, just
mypoint POINT <>
Title: Re: Struct help!
Post by: wizzra on April 28, 2005, 06:28:55 PM

.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 ...
Title: Re: Struct help!
Post by: QvasiModo on April 28, 2005, 06:55:53 PM
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 <?,?>
Title: Re: Struct help!
Post by: pbrennick on April 28, 2005, 07:35:19 PM
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
Title: Re: Struct help!
Post by: Artoo on April 29, 2005, 01:31:47 AM
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.