NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: xdcx on November 25, 2012, 03:09:29 AM
-
following this example:
http://cs.lmu.edu/~ray/notes/nasmexamples/
global _main
extern _printf
section .text
_main:
push message
call _printf
add esp, 4
ret
message:
db 'hello world',10,0
http://s9.postimage.org/8x3eltczx/nasm_ld.jpg
i don't have 'ld' in environment variables
(win 7:64)
-
k im using mingw32, is this the only way?
-
now getting: Undefined Reference To 'printf'
using same source code on site
-
Try adding "-lc" to the "ld" command line...
MinGW32 is not the only way to do it, but if you've gotten this far you might as well continue with it. Note that you're not doing it quite like the example you cite, but it "should" work, I think.
As an alternative, take a look at NASMX:
http://sourceforge.net/projects/nasmx/files/nasmx-1.1/Windows/
Let us know how you solve this, if you would...
Best,
Frank
-
now im using link.exe from masm/VC instead of mingw (its nice though cause its like linux)
link.exe file.obj libcmt.lib
compiles fine
-
You need to add the path to \MinGW\bin to your PATH environment variable in control panel, or use the full path to ld.
Or, you could just use GoLink which works great.