Salut à toutes et à tous
Sans même avoir réussi à exécuter un programme, me voici déjà confronté à un problème. Je suis actuellement un des tutoriels disponibles sur ce site, traitant du Microsoft Assembler.
Premier exemple concret, un simple hello world comme on les aime. Mais hélas...
Que fais-je de travers ?D:\Projects\LearnAsm>ml helloworld.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: helloworld.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/z2
"helloworld.obj"
"helloworld.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
helloworld.obj : warning LNK4033: converting object format from OMF to COFF
LINK : fatal error LNK1181: cannot open input file "helloworld.exe"
Si je tente un link du fichier .obj par après, voici le résultat:
Voici le code impliqué:D:\Projects\LearnAsm>link helloworld.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
helloworld.obj : warning LNK4033: converting object format from OMF to COFF
LINK : fatal error LNK1561: entry point must be defined
Autre question en passant: j'ai été obligé de mettre les chemins vers les inclusions en chemins absolus... comment bypasser ça ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 .386 .model flat, stdcall option casemap:none include C:\masm32\include\windows.inc include C:\masm32\include\user32.inc includelib user32.lib include C:\masm32\include\kernel32.inc includelib kernel32.lib .data MsgBoxCaption BYTE "Hello World!", 0 MsgBoxText BYTE "Un bon langage aujourd'hui vaut mieux qu'un langage parfait demain", 0 .code start: invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK + MB_ICONASTERISK invoke ExitProcess, 0 end start
Partager