first I’m new to assembly langage i want to learn it, I am actually on Windows 11 (x64, Intel core I5 11400H), coding with Notepad, and for building step, i use NASM and GoLink.
The problem that i have is when i try to build my program (main.asm), i have the following error printed into my console :
`GoLink.Exe Version 0.26.14 – Copyright Jeremy Gordon 2002/9 – [email protected]
Error!
The following symbols were not defined in the object file or files:-
MessageBoxA
ExitProcess
Output file not made`
The commands i use for building (inside compile.bat file located in the same folder as main.asm) are :
@echo off nasm -f win64 main.asm -o main.obj GoLink /entry main main.obj kernel32.lib user32.lib pause
And finnaly, the asm code inside my main.asm file is :
`section .data
message db ‘Hello World !’, 0
title db ‘Greetings’, 0
section .text
global main
extern MessageBoxA
extern ExitProcess
main:
mov rdi, 0
mov rsi, message
mov rdx, title
mov rcx, 0
call MessageBoxA
mov eax, 0
call ExitProcess
`
I actually tried to :
-
Rename user32.lib and kernel32.lib to user32.Lib and kernel32.Lib
-
Change theses files to their absolute path
(Exemple C:Program Files (x86)Windows Kits10Lib10.0.26100.0umx64kernel32.Lib instead of kernel32.lib)
I read that to resolve the problem, i must change “extern MessageBoxA” to “extern _MessageBoxA@(which i don’t know what number to put here”
And same for ExitProcess (to _ExitProcess@4) but it don’t work
Thank you in advance for your answer (ps : I’m french so sorry if my english is bad).
Gwengwen49 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.