News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

error A2004: symbol type conflict

Started by jimg, February 23, 2020, 02:56:25 AM

Previous topic - Next topic

jimg

I get "error A2004: symbol type conflict" from assembling the following program with masm (it works with uasm).
.nolist
.686p
.model flat,stdcall
option casemap:none
.nolist
include windows.inc
include kernel32.inc
include user32.inc
includelib kernel32.lib
includelib user32.lib
.list
.data
tbuf db 100 dup (?)
crlf = $
     db 13,10,0
txt1 db "line1",0
txt2 db "line2",0
fmt  db "%s%s%s%s",0
.code

Program:
  invoke wsprintf,addr tbuf,addr fmt,addr txt1,crlf,addr txt2,crlf
  invoke MessageBox,0,addr tbuf,0,0
  Invoke ExitProcess,0
End Program

Masm doesn't like using "crlf" to push the address of the text for crlf.  This is just an example of a shorthand method I normally use to avoid having to type an extra four characters, i.e.  addr crlf, but I'm curious if there is some way to make masm happy doing this without adding a ton of code.
This is not a big deal, since very few of my programs will assemble with masm anymore without a bunch of changes, so don't spend a lot of time, I just thought someone might know off the top of their head.