The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: OS on March 23, 2006, 01:47:57 PM

Title: using LINK.EXE
Post by: OS on March 23, 2006, 01:47:57 PM
I am trying to use LINK.EXE with nasm I keep getting the error that my imports can't be found. Any LINK gurus know how I could overcome this? I have tried my LIBPATH set to the masm lib and the nasm win32.lib. still it says there unreferenced.
EXAMPLE....
error LNK2001: unresolved external symbol GetModuleHandleA
Thanks for any help on this one.
Title: Re: using LINK.EXE
Post by: hutch-- on March 23, 2006, 02:06:40 PM
It will depend on how the libraries in NASM are built. To use any of the API functions you will need some valid way to access them otherwise other libraries that assume API functions being available will fail for this reason.
Title: Re: using LINK.EXE
Post by: MichaelW on March 23, 2006, 03:16:57 PM
OS,

For NASM I think it would be easier to use GoLink, available here:

http://www.jorgon.freeserve.co.uk/

You would need to provide extern directives for the called functions in the NASM source, and list the files containing the exports on the GoLink command line.

Title: Re: using LINK.EXE
Post by: OS on March 23, 2006, 03:34:56 PM
I had some time figuring this out look below.
Title: Re: using LINK.EXE
Post by: OS on March 23, 2006, 04:02:40 PM
OKay figured it out, needed to use type win32 command on the assembler and make sure all my data was classed as DATA because golink was mangling it.