#65 #include failed

compiler
open
John Hansen
NBC (24)
5
2013-01-02
2009-03-08
Anonymous
No

Hello everybody,

I'm using nbc-1.0.1.b35 for Linux.

Following issue occurs:
Using an include statement like this
#include "/tmp/tuxminds.h"
the compiler says:

# Error: Unable to find include file: "/tmp/tuxminds.h"
File "/tmp/void.nxc" ; line 13
but it's already present.

So i used "strace" to find out what happens:
access("/home/home3/project/nbc//tmp/tuxminds.h", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/include/nbc//tmp/tuxminds.h", F_OK) = -1 ENOENT (No such file or directory)
access("/tmp//tmp/tuxminds.h", F_OK) = -1 ENOENT (No such file or directory)

'nd try:
ok, may be the absolute path does not be optimal.
I changed the statement into
#include "tuxminds.h"

answer from nbc:
# Error: #include directive requires a filename (e.g., #include "foo.h")
File "/tmp/void.nxc" ; line 29

strace-log (excerpt):
access("/home/home3/project/nbc/tuxminds.h", F_OK) = 0
open("/home/home3/project/nbc/tuxminds.h", O_RDONLY|O_LARGEFILE) = 3

But it's the WRONG FILE (the name matches, but the file is not for the brick :-)

'rd try:
#include <tuxminds.h>

# Error: #include directive requires a filename (e.g., #include "foo.h")
File "/tmp/void.nxc" ; line 13
Ok- using <> is not a vild syntax.

It seems that the order of gessing the includefile is not optimal and so nbc get puzzled.

Is there a solution ?

If you like you may visit our project to see what we are working on: http://www.sourceforge.net/projects/tuxminds

Kindly Regars
Karsten (tuxtrainer@t-online.de)

Discussion