Author Topic: Problem with IMPORT directive.  (Read 8868 times)

nobody

  • Guest
Problem with IMPORT directive.
« on: November 23, 2005, 10:56:00 PM »
I get the following problem when trying to import LoadLibrary from kernel32.dll.

import.asm:8: error: parser: instruction expected

8 is the line with the directive. Removing the directive fixes the error.

Code:

extern LoadLibrary
import LoadLibrary kernel32.dll

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Problem with IMPORT directive.
« Reply #1 on: November 24, 2005, 03:02:42 AM »
"Import" is only good in "-f obj" - are you using "-f obj" or "-f win32"?

Best,
Frank

nobody

  • Guest
Re: Problem with IMPORT directive.
« Reply #2 on: November 24, 2005, 01:26:03 PM »
I see. I was using "-f win32".

Thanks for solving that for me. But another question: Would I use obj if I were to create libraries to link with my nasm files? Ie. Could I import a few functions into an obj file, and then use that while linking?