The MASM Forum
General => The Campus => Topic started by: jannes braet on June 18, 2012, 10:17:29 PM
-
hello
i'm following the iczelion's win32 assembly tutorial (http://win32assembly.online.fr/tut8.html (http://win32assembly.online.fr/tut8.html)) and in this tutorial he makes a .asm file and a .rc file. i have saved the .rc file in the same folder as the .asm file and i have also compiled it to a .res file. now if i try to compile the file and if i run it it doesn't show a menu (which should be supposed to do) so now i think i'm doing something wrong with my Link:
in cmd i type : Link /SUBSYSTEM:WINDOWS hello.obj
but i believe i should add something to this to link the .res file to this but i don't know what. can someone please help me out with this?
(source codes are in the link i showed)
-
Hi Jannes,
You use the linker, either as a RES file or after converting it to an OBJ file with CVTRES.EXE. For the RES file or the extra OBJ file you need to add it to the object file list on the command line.
Use a command line like this.
\masm32\BIN\Link.exe /SUBSYSTEM:WINDOWS mangled.obj rsrc.obj
-
\masm32\bin\ml -Fl -coff -c hello.asm
\masm32\bin\rc hello.rc
\masm32\bin\link /SUBSYSTEM:WINDOWS hello.obj hello.res
-
thanks. it works now.
-
Hi Jannes,
There is also Pelle's resource compiler coming with the Masm32 installation :
\masm32\bin\porc.exe
-
\masm32\bin\ml -Fl -coff -c hello.asm
\masm32\bin\rc hello.rc
\masm32\bin\link /SUBSYSTEM:WINDOWS hello.obj hello.res
Hmm, that's odd: I notice you didn't include the CVTRES step:
cvtres /machine:ix86 hello.resIs this not needed? Have I been doing this (in my batch files) needlessly?
I'm using LINK just like you, except I'm linking the .obj created by CVTRES. So can you link the .res file directly? What's the difference?
-
i didn't know you could do that with MS link
i know that PoLink will accept a RES file directly, though
-
From memory LINK calls CVTRES if the appended file has a RES extension.
-
From memory LINK calls CVTRES if the appended file has a RES extension.
OK, so 6 of one and half a dozen of the other (invoking CVTRES explicitly in the batch file vs. just linking the .res file), right?
-
:biggrin:
yourdrive:/>path\cvtres.exe /?
Yields,
Microsoft (R) Windows Resource To Object Converter Version 5.00.1736.1
Copyright (C) Microsoft Corp. 1992-1997. All rights reserved.
usage: CVTRES [options] ResFile
options:
/MACHINE:{IX86|ALPHA|ARM|AXP64|IA64|MIPS|MIPS16|MIPSR41XX|PPC|SH3|SH4}
/NOLOGO
/OUT:filename
/READONLY
/VERBOSE
/WINDOWSCE[:{CONVERT|EMULATION}]
-
i didn't know you could do that with MS link
i know that PoLink will accept a RES file directly, though
Hi Dave,
Yes, polink does not depend on another tool. It accepts a compiled resource file directly.
-
Hmm, that's odd: I notice you didn't include the CVTRES step
Indeed, it's a shortcut, a lot of compilers and linkers are even smarter that this. In fact some will take DLL's as inputs and figure out the linkage, rather than fanny around with imp/exp/lib type files.
LINK will run tools like CVTRES and CVPACK
You can use "CL hello.c setargv.obj" and it will downstream the object to the linker.