flat assembler
Message board for the users of flat assembler.

Index > Windows > Symbol already defined errors

Author
Thread Post new topic Reply to topic
lostcauz



Joined: 22 Mar 2012
Posts: 13
lostcauz 27 Mar 2012, 12:33
What's the correct method for declaring a control array? I keep getting symbol already defined errors with my attempts.

Code:
hwndEdit dd 12 dup (?)    
Post 27 Mar 2012, 12:33
View user's profile Send private message Visit poster's website Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade 27 Mar 2012, 12:35
Why not:
Code:
hwndEdit rd 12
    
Post 27 Mar 2012, 12:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 27 Mar 2012, 12:37
"symbol already defined" means you have duplicate labels of the same name defined in more than one place. Your code fragment above looks perfectly fine, by itself, but clearly you have more code than that, and I would expect you have at least one other place where you define hwndEdit.
Post 27 Mar 2012, 12:37
View user's profile Send private message Visit poster's website Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade 27 Mar 2012, 12:43
Actually, yeah, what rev says. The code in my post does the same as yours, only slightly different, but wouldnt solve the symbol already defined error. The only benefit with the way that i'm doing it is that if you put it in the right section, you can save yourself from adding those extra 12 bytes to the executable, and instead it will allocate them from memory at load-time (is it .bss in windows too?)..

Anyway, yeah, you must be defining this variable more than once.. are you trying to use it inside a macro which you are using multiple times?
Post 27 Mar 2012, 12:43
View user's profile Send private message Reply with quote
lostcauz



Joined: 22 Mar 2012
Posts: 13
lostcauz 27 Mar 2012, 12:50
gunblade, I already tried that one too.

revolution, I checked again to be sure. No other definitions.
I assume the error is from this definition but the error only states:
Code:
      label dd RVA _label
error: symbol already defined.
    

I'm tired and confused. Maybe the issue is how I am accessing the array to create the controls. Confused
Post 27 Mar 2012, 12:50
View user's profile Send private message Visit poster's website Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade 27 Mar 2012, 12:56
Hmm.. pretty sure label is a reversed keyword.. have you tried changing that to label2 or some other word..?

EDIT: Yeah.. just tested it - you deffinetly cant use the word label.. its a keyword used by fasm. if you change your code to:

Code:
label2 dd RVA _label    


it should work fine
Post 27 Mar 2012, 12:56
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 27 Mar 2012, 13:03
lostcauz: Post your code please. We can't help you without more information.
Post 27 Mar 2012, 13:03
View user's profile Send private message Visit poster's website Reply with quote
lostcauz



Joined: 22 Mar 2012
Posts: 13
lostcauz 27 Mar 2012, 13:06
That's from import32.inc
Code:
flat assembler  version 1.69.50  (1023795 kilobytes memory)
\api\user32.inc [4]:
import user32,\
import32.inc [50] import [24]:
       label dd RVA _label
error: symbol already defined.    

Does anyone have an example of creating a control array so I can resolve the issue in my code?
Post 27 Mar 2012, 13:06
View user's profile Send private message Visit poster's website Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade 27 Mar 2012, 13:10
Oh..

Yeah.. label is used as a parameter to a macro in that context, so thats ok - it seems like you may be using the import macro wrongly.. It would help to see your code, at the very least the final '.idata' section containing the library/import code.


Last edited by gunblade on 27 Mar 2012, 13:41; edited 1 time in total
Post 27 Mar 2012, 13:10
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 27 Mar 2012, 13:12
lostcauz: You have defined a label the same as one of the API functions. Perhaps you could post your code?
Post 27 Mar 2012, 13:12
View user's profile Send private message Visit poster's website Reply with quote
lostcauz



Joined: 22 Mar 2012
Posts: 13
lostcauz 27 Mar 2012, 13:37
Thanks revolution! That statement about the api tipped me off. I changed the name of one of my procs and it assembles fine. Although, it appears I still have issues since the edit controls are not showing up. I'm just thankful it assembled.

I appreciate the help!
Post 27 Mar 2012, 13:37
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 28 Mar 2012, 03:57
revolution wrote:
lostcauz: You have defined a label the same as one of the API functions. Perhaps you could post your code?


Shocked Every time you have to repeat the same thing just so some newbie can understand you. I feel ya !

I guess it's hard being a mod(although it could apply to anyone with a different profile), perhaps. Is it? Tell me rev...

Is there like a "read this before you post questions" sticky thread ?
Post 28 Mar 2012, 03:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 28 Mar 2012, 05:07
typedef wrote:
Shocked Every time you have to repeat the same thing just so some newbie can understand you. I feel ya !
Everybody has to start somewhere, we can't expect newcomers to instantly know what is going on.
typedef wrote:
I guess it's hard being a mod(although it could apply to anyone with a different profile), perhaps. Is it? Tell me rev...
You are welcome to help newcomers also. Modship is not a requirement for helping people.
typedef wrote:
Is there like a "read this before you post questions" sticky thread ?
There are already many sticky threads of this nature here, but they can't ever hope to cover every possible situation.
Post 28 Mar 2012, 05:07
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 28 Mar 2012, 09:13
revolution wrote:
You are welcome to help newcomers also. Modship is not a requirement for helping people


Very Happy
The thing with me is that I have a tendency of trying to provide the whole solution to newbies. But that's how I deepen my skills also. Maybe I should take it easy then. Smile
Post 28 Mar 2012, 09:13
View user's profile Send private message Reply with quote
lostcauz



Joined: 22 Mar 2012
Posts: 13
lostcauz 28 Mar 2012, 13:02
typedef wrote:

Shocked Every time you have to repeat the same thing just so some newbie can understand you. I feel ya !

I guess it's hard being a mod(although it could apply to anyone with a different profile), perhaps. Is it? Tell me rev...

Is there like a "read this before you post questions" sticky thread ?


Some newbie? I suppose you mean new to fasm. Your post adds nothing to this discussion. BTW, did you ever figure out how to assemble the other program I posted that everyone else was able to run?
Post 28 Mar 2012, 13:02
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 28 Mar 2012, 20:03
lostcauz wrote:
typedef wrote:

Shocked Every time you have to repeat the same thing just so some newbie can understand you. I feel ya !

I guess it's hard being a mod(although it could apply to anyone with a different profile), perhaps. Is it? Tell me rev...

Is there like a "read this before you post questions" sticky thread ?


Some newbie? I suppose you mean new to fasm. Your post adds nothing to this discussion. BTW, did you ever figure out how to assemble the other program I posted that everyone else was able to run?


Holy mother of ass broah ! hahahaha. Get over yourself

I have no interest in that program or whatever shizzle it does. Sorry if I have been unwelcoming because I made your program compile to 11mb Very Happy Very Happy .

Cheer up son. Good days are always ahead

Image
Post 28 Mar 2012, 20:03
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.