include not found

Linux specific questions.
Post Reply
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

include not found

Post by Dinosaur »

Hi All
Debian 10 on PC uses:
FreeBASIC Compiler - Version 1.07.1 (2019-09-27), built for linux-x86 (32bit)
Debian 10 on Beaglebone black uses:
fbc-0.91.0-bbb-debian 32 bit
Why is it that if I add a new .bi file to the /FreeBasic/include/freebasic/ directory , that this file is not found by the compiler.
If I replace a file with an updated one, there is no problem.

I have checked the names, permissions and spelling, but for it to be recognised by the compiler
the full path has to be added.

Code: Select all

''FB Includes
#include once "file.bi"
#Include once "allegro.bi"
#Include once "cgui.bi"
#include once "/home/dinosaur/FreeBasic/include/freebasic/snc.bi"
''Project Includes
#Include once "includes/types.bi"
#Include once "includes/declares.bi"
#Include once "includes/presets.bi"
I can reload the environment or reboot, it makes no difference.

What am i missing ?

Regards
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: include not found

Post by TeeEmCee »

Is ~/FreeBasic/include/freebasic really the directory that copy of fbc checks for includes? Try "fbc -showincludes somefile.bas" for a file including some standard includes, and see where they are found. Of course fbc will look for includes in a path relative to where it is installed.

But I have no idea what to make of "If I replace a file with an updated one, there is no problem", I can't imagine what could cause that.
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: include not found

Post by Dinosaur »

Hi All

If you extract the .tar to your disk it uses a long hand name that is just to much typing
and hard to remember. So I always rename the folder to FreeBasic.
Then when you run ./Install.sh -i it will also put them in /usr/local/include/freebasic
But I have no idea what to make of "If I replace a file with an updated one, there is no problem", I can't imagine what could cause that.
include not found
What I meant by that was if the .bi file was installed there by the ./install.sh -i then changing it by putting a new one there
didn't cause any problems. If however it was never there (as was the case with Joshy's snc.bi) then the fb compiler could not find it.
Regardless of what I tried.

In the end I had to put the snc.bi in the folder prior to running ./install.sh -i
I forgot to mention that the installation is using the ARM version of FB.

Regards
Kuan Hsu
Posts: 586
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: include not found

Post by Kuan Hsu »

Dinosaur wrote:Hi All

If you extract the .tar to your disk it uses a long hand name that is just to much typing
and hard to remember. So I always rename the folder to FreeBasic.
Then when you run ./Install.sh -i it will also put them in /usr/local/include/freebasic
But I have no idea what to make of "If I replace a file with an updated one, there is no problem", I can't imagine what could cause that.
include not found
What I meant by that was if the .bi file was installed there by the ./install.sh -i then changing it by putting a new one there
didn't cause any problems. If however it was never there (as was the case with Joshy's snc.bi) then the fb compiler could not find it.
Regardless of what I tried.

In the end I had to put the snc.bi in the folder prior to running ./install.sh -i
I forgot to mention that the installation is using the ARM version of FB.

Regards
Dear Dinosaur:
Where your FBC compiler is?
By ./install.sh -i , FBC compiler install in /usr/local/bin, so the snc.bi need put in /usr/local/include/freebasic
FBC is finding include files by FBCPATH/../include/freebasic
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: include not found

Post by TJF »

By executing in a terminal

Code: Select all

$whereis fbc
fbc: /usr/local/bin/fbc
you can find out the path of your compiler. As Kuan Hsu mentioned, the compiler loads .bi files from path ../include/freebasic, which results in the above example in /usr/local/bin/../include/freebasic, which is equal to /usr/local/include/freebasic.
Post Reply