Using link.exe with the visual studio command prompt:
link.exe "C:\Users\Jon\Desktop\euler\asm\test" kernel32.dll
provides the ever helpful: LINK : fatal error LNK1181: cannot open input file 'kernel32.dll'
Why can’t it link against a system dll?
I moved on to GoLink:
"C:\Program Files (x86)\nasm\golink.exe" /console test.obj Kernel32.dll
Which links just fine, but crashes as soon as I run it.
I’m using NASM "C:\Program Files (x86)\nasm\nasm.exe" -fwin64 "test.asm"
Here’s my assembler Pastebin
MSVC’s link cannot link directly to a DLL – you’ll need to use the
kernel32.libimport library instead:You will need to make sure that the environment is set up correctly so
link.execan find the import library. That’s often done by thevcvarsall.bat(or similar) script/batch file that configures the command line window used to run the tools. If you don’t have something configuring the environment for the build tools, you’ll need to pass in the location of the library, either by using the full path or by passing in a directory with the/libpathlinker option.I don’t know what GoLink is, so I can’t comment on what it’s doing right or wrong…