The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: baronpan on September 24, 2009, 02:38:36 PM

Title: an strange link problem with golink
Post by: baronpan on September 24, 2009, 02:38:36 PM
 :(
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
Title: Re: an strange link problem with golink
Post by: dedndave on September 24, 2009, 03:01:45 PM
i don't use nasm, but
it sounds like it's not opening a code segment
with no code segment, "start:" doesn't get created
try this...

.code
start:
ret
end start
Title: Re: an strange link problem with golink
Post by: baronpan on September 24, 2009, 03:06:43 PM
whether i have add [section .text] or not , it cannot solve the problem !but thank you any way
Title: Re: an strange link problem with golink
Post by: akane on September 24, 2009, 03:25:37 PM
Nasm does not export symbols like C/C++ does by default, you need to use the global directive:
segment .text
global main

main: ret  ; /entry main
Title: Re: an strange link problem with golink
Post by: baronpan on September 24, 2009, 03:34:17 PM
 :bg

Thank you very much!