Jump to content

Include files

- - - - -

  • Please log in to reply
2 replies to this topic

#1
DarkLordofthePenguins

DarkLordofthePenguins

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 409 posts
I started reading a PDF on NASM, and it requires certain files from the website. So I went to the website and downloaded the Linux ZIP (The website didn't have one for Mac OS X. There were versions for things like DJGPP and Cygwin but not Mac OS X. Go figure.) The object files were in the ELF format, so I reassembled the include file into Mach-O so the Mac version of NASM could read it. I hope that was enough.

But still, I keep getting this error when I use the %include directive:


first.s:1: error: `%include' expects a file name


I'm beginning to think it's not the executable format that's the problem, but something to do with the syntax. I used this line of code:


%include asm_io.inc


I don't think it has anything to do with the existence or readability of asm_io.asm, asm_io.inc, or asm_io.o. The assembler just isn't recognizing asm_io.inc as a filename for some reason.
Programming is a journey, not a destination.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
It is likely that it needs to be in 'string' format, i.e. %include "file.inc".

I would assume this would allow whitespace in file names where whitespace is allowed "my include.inc"
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
DarkLordofthePenguins

DarkLordofthePenguins

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 409 posts
Yes, that works. Thank you.
Programming is a journey, not a destination.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users