:sad:
I met a very strange link error when writing a very simple asm. I used nasmx and the link tool is golink0.26.9e.

my program test.asm is just like :

start:

      ret

and i used  nasm -fwin32 -o test.obj test.asm to generate a obj file ,and it's done.
and i used  golink /entry start test.obj, it shows the error message :

Error!
The following symbol was not defined in the object file or files:-
start
Output file not made

why is that?
and i then include the windows.inc head file  in nasmx
it's well done then!

why is that ?what's the reason.

anyone can help me ?thanks
Posted on 2009-09-24 10:15:43 by baron
Until 'start:' gets exported it's not accessible at the linker level. You need to define the label as being a globally exported label. Try:

GLOBAL start
start:
  PUSH DWORD 0
  CALL _ExitProcess@4


(I can't exactly remember if GoLINK  needs decoration or not, Alink did.. I've been on *nix way too long XD)
Anyways, that should let the linker know that 'start:' exists and you can't exactly just 'ret' like you do when using libc through 'main:' because you are handling the startup/shutdown stuff yourself so you need to call ExitProcess or your program will return to a non-existent address and crash.

Posted on 2009-09-27 20:42:27 by Synfire
Try this
\nasm\bin\golink  @\nasm\bin\GFL.txt  /console /entry Start:
Posted on 2009-09-28 22:21:21 by Klod
Synfire is correct, unless you are using NASMX's ENTRY/PROC combination, you need to explicitly export (GLOBAL) the symbol and decorate it accordingly as per the toolchain.
Posted on 2009-09-29 19:40:57 by SpooK