include not found

Linux specific questions.
Dinosaur
Posts: 1357
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

include not found

Postby Dinosaur » May 27, 2020 1:29

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: 298
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: include not found

Postby TeeEmCee » May 29, 2020 2:35

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: 1357
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

Re: include not found

Postby Dinosaur » May 31, 2020 1:06

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: 470
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: include not found

Postby Kuan Hsu » May 31, 2020 15:31

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: 3601
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: include not found

Postby TJF » Jun 16, 2020 6:47

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.

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest