Author Topic: nasm: fatal: unable to open include file  (Read 12373 times)

Offline MediocreVeg1

  • Jr. Member
  • *
  • Posts: 26
nasm: fatal: unable to open include file
« on: January 07, 2021, 06:09:45 AM »
I've seen some other questions regarding this, but none of them seem to help.
My NASM directory is:
Code: [Select]
NASM/
  test.asm
  include/macros/
    loops.inc
    consoleIO.inc
my consoleIO.inc file includes my loops.inc file and my test.asm file includes both, but when i try to assemble test.asm it says:
Code: [Select]
include/macros/consoleIO.inc:3: fatal: unable to open include file `loops.inc'Not sure if this information is needed, but I'm running my NASM on a Xubuntu VM and its version is 2.14.02. Thanks in advance :)

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 221
  • Country: gb
    • GPUZoo
Re: nasm: fatal: unable to open include file
« Reply #1 on: January 07, 2021, 06:26:08 AM »
Please post the relevant line of your .asm file so we cab see how you are declaring it. Nasm needs the relative path to the include file.
My graphics card database: www.gpuzoo.com

Offline MediocreVeg1

  • Jr. Member
  • *
  • Posts: 26
Re: nasm: fatal: unable to open include file
« Reply #2 on: January 07, 2021, 06:41:23 AM »
Code: [Select]
%include "include/macros/consoleIO.inc"
%include "include/macros/loops.inc" ; Lines 1 and 2
« Last Edit: January 07, 2021, 06:43:00 AM by MediocreVeg1 »

Offline MediocreVeg1

  • Jr. Member
  • *
  • Posts: 26
Re: nasm: fatal: unable to open include file
« Reply #3 on: January 07, 2021, 08:26:53 AM »
UPDATE: So I tried including loops.inc with the absolute path, and it actually worked. But this just seems unnecessary and could cause issues in the future where i would have to change the absolute path every single time. Isn't there a proper way to include relative path?

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 221
  • Country: gb
    • GPUZoo
Re: nasm: fatal: unable to open include file
« Reply #4 on: January 07, 2021, 09:53:55 AM »
I would have expected that to work, but I keep include files in the same directory as my asm files, so am unsure. Do you know whether it worked right in older versions of nasm?
My graphics card database: www.gpuzoo.com

Offline MediocreVeg1

  • Jr. Member
  • *
  • Posts: 26
Re: nasm: fatal: unable to open include file
« Reply #5 on: January 07, 2021, 10:01:21 AM »
Sorry for the late reply :P
For the version thing, no. I downloaded NASM on this version and I'm not even sure how to change the version. The strangest thing is that including the libraries in the .asm file works just fine, but if I'm including one header file into another header (with relative path), it gives the fatal error.

[EDIT Unrelated, but another issue is that when i do %endrep NASM thinks I'm trying to do modulus on a label. Maybe I half-downloaded it or something like that, 'cause its really scuffed right now
« Last Edit: January 07, 2021, 10:12:27 AM by MediocreVeg1 »