After assembling Iczelion's tutorial examples #2 and #3,I discovered that the object files are
importing the function wsprintfA. Many of my object files has a reference to the wsprintf function
where I don't use it all,(+ no any static library used)
What's the reason? How can I avoid this?
Posted on 2003-05-11 08:15:25 by Vortex
It may be used by some of your macro functions or import libraries. I know that dw2a in the MASM32 library uses it, that's probably the lib that's importing it.
Posted on 2003-05-11 08:51:22 by donkey
Donkey,as I said in my first post,I don't use any static lib,neither any macro.
Just,try to assemble Iczelion's tutorial #2 or #3,you will see that the object file imports
the wsprintf function.
Posted on 2003-05-11 08:58:29 by Vortex
The object files do not contain the mentioned reference on my system (Icz tut 2 and 3), but I guess that could be because I am using an older version of masm32.

It doesn't matter much, though, since the linker will see that it's not used, and not add it to the executable.
Posted on 2003-05-11 09:58:53 by Jibz
I compiled #2 and # 3 and I have no wsprintf imported in either the exe or obj file. (using ML.EXE (v7) and Link.EXE (v7) MASM32 (v8) )

EDIT: Here's the ML and Link I used :
ML.EXE /c /coff /Cp /nologo /I"C:\Masm32\Include" "MSGBOX.asm"

LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0 /LIBPATH:"C:\Masm32\Lib" "MSGBOX.obj"
Posted on 2003-05-11 10:04:00 by donkey
wsprintf is a user32 exported func being treated differently (vararg and c call). don't know in which include it's declared i'm almost sure it's not user32.inc. It happened to me also before I discovered it's declared twice in the includes chain. After removing the surplus definition it stopped to be imported, hth.
Posted on 2003-05-11 17:48:25 by _Servil_

wsprintf is a user32 exported func being treated differently (vararg and c call). don't know in which include it's declared i'm almost sure it's not user32.inc. It happened to me also before I discovered it's declared twice in the includes chain. After removing the surplus definition it stopped to be imported, hth.

It is declared twice, once in Windows.inc and once in user32.inc. I think that the fact that Windows.inc is necessary regardless and user32 is not always used, it was declared in Windows.inc to enable the MASM32 library to function without user32?

But on my system it still did not import the function.
Posted on 2003-05-11 18:59:47 by donkey
Donkey,Servil,

I solved the problem:I removed the declaration of wsprintf in the primary include
file windows.inc Now,the object code doesn't contain any reference to wsprintf

Thank you very much:alright:
Posted on 2003-05-12 02:06:35 by Vortex