1

I am trying to link my assembly script with a resource file made with ResEdit that both belong to the same directory with the .bat file:

@echo off
C:\masm64\ml64.exe dialog_box.asm /link /entry:Main resources.res /subsystem:windows /defaultlib:"C:\masm64\kernel32.Lib" /defaultlib:"C:\masm64\user32.Lib" /defaultlib:"C:\masm64\ComCtl32.Lib" /LARGEADDRESSAWARE:NO
 pause

As a result I am getting .exe file that is supposed to show a dialog on the screen but after opening it nothing happens. I am also getting some shortcut file after linking that does not take place normally (when I am not using any .res file during linking). I am not sure what I'm doing wrong. I've also tried to use cvtres.exe to convert .res file to .obj file and substitute it at the .bat file but the result was the same. The assembly code is correct since I've copied it from a book.

Bart
  • 11
  • 1

1 Answers1

0

I've also tried to use cvtres.exe to convert .res file to .obj file and substitute it at the .bat file but the result was the same.

I assume you have been thinking that this resource file needs to be compiled but there is a significant difference between .rc and .res file. The .rc file is simply a resource script, while .res file is already compiled resource file. When linking, you need to have compiled files in order to produce the final executable.

Do make sure that you are using correct identifiers in your script because this is most likely the reason you are not seeing the output. Also, make sure that you have provided appropriate paths to the dlls linker needs.

Regarding the shortcut file created by the linker, I managed to reproduce this and I am not quite sure what is the purpose of it, neither could I have found any switch in Microsoft documentation to turn off this behavior, so probably the fastest way to get rid of it is to modify batch script by adding:

del mllink$.lnk