Author Topic: import directive  (Read 9028 times)

nobody

  • Guest
import directive
« on: January 12, 2010, 03:41:53 AM »
I need to import a function:

import HtmlHelpA HHCTRL.OCX



As per the docs --> import  WSAStartup wsock32.dll
I made sure the dll is in the same directory as my source file

This gives me a compile time error-->   error: parser: instruction expected

Is this a discontinued function?

Nasm 2.08rc1
Klod

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: import directive
« Reply #1 on: January 12, 2010, 05:30:12 AM »
Hi Klod,

It is "discontinued", in that it is only available in "-f obj" output format. From the error, I suspect you're using "-f win32"? Won't work. Supposedly "not required". I think that information is in the library, bot in the object file that Nasm produces, in "PECOFF" format(?). I understand that we can put imports in a file, assemble it to "-f obj" (OMF format), and link that file with a "-f win32" .obj. Haven't tried it. Dunno what linkers that would work with... Or do the whole thing in "-f obj", of course. "-f win32" is a more "modern" format, I think, but I don't know what the "advantages" are, if any.

Best,
Frank