NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: iVision on July 24, 2013, 04:56:42 PM
-
Hello, sorry ignore the previous text that was here :P
How do I set an include path for nasm? And (to me its a bug) why does the cmd prompt needs to be in that folder, otherwise include doesn't work:
Files:
path\Server\socket.asm
path\Server\main.asm
path> nasm -f win32 Server\main.asm
It will fail that it cannot find %include "socket.asm"
But the main thing, how to set a include path?
Regards
-
Try this ( note the squared brackets around the section ):
[section .bss]
emptyArray: resb 10
-
Just noticed its my bad, compiled the wrong file.. Anyway I have another problem, so Ill edit the main thread..
-
My understanding of the difference between "[section .bss]" and "section .bss" is that the latter is a macro which besides producing "[section .bss]" sets the "__SECT__" macro. It "shouldn't" make any difference besides that. I'd be looking at what comes after the code you posted. Do you switch to some section that allows initialized data before trying to initialize data (or code)? What you show looks "right" to me, so I suspect the problem is in something you don't show...
Best,
Frank
-
Heh! Okay, ignore previous answers.
path> nasm -f win32 Server\main.asm -i Server\
(note that the trailing backslash is mandatory!)
In its zeal to be "OS-agnostic", Nasm doesn't do very well in following you around from directory to directory. The easiest thing may be to specify the complete path to the include file...
%include "C:\path\Server\socket.asm"
... or whatever is appropriate.
Best,
Frank
-
Heh! Okay, ignore previous answers.
path> nasm -f win32 Server\main.asm -i Server\
(note that the trailing backslash is mandatory!)
In its zeal to be "OS-agnostic", Nasm doesn't do very well in following you around from directory to directory. The easiest thing may be to specify the complete path to the include file...
%include "C:\path\Server\socket.asm"
... or whatever is appropriate.
Best,
Frank
Okay too bad, is it possible to set includes? I mean I haven't find any settings file, why isn't it there? It would be nice if you could add C:\nasm\inc so that you can use %include "somefile.inc" instead of %include "C:\nasm\inc\somefile.inc"
Would be a really nice feature! But I guess I have to stick with full paths or nasm -i flag
Regards
-
set NASMENV=-IC:\nasm\inc\
-
As Rob says, NASMENV is probably your best bet. Nasm does not (and probably never will) depend on any external file for its functioning.
Best,
Frank