Library Path Problem

Linux specific questions.
storm5510
Posts: 20
Joined: Nov 28, 2019 15:47

Library Path Problem

Postby storm5510 » Nov 30, 2019 19:20

Greetings. I am new to Linux so you must forgive me for my ignorance. What I have is Ubuntu 19.10.

I managed to get fbc compiled to the point where it will execute by following the suggestions on the screen, and with a bit of searching on the web. I have a short test program with this at the top:

Code: Select all

#include "string.bi"

I run the compiler like so:

Code: Select all

./fbc test.bas -e

I am presented the following error message:

Code: Select all

test.bas(3) error 23: File not found, "string.bi" in '#include "string.bi"'


There is an option "-p" to specify a path, so I run it like this:

Code: Select all

./fbc test.bas -e -p /home/storm5510/fb/include/freebasic/


The error message repeats. The "string.bi" file exists in the path. I really do not know what to do at this point. Any assistance would be helpful. Thank you!
badidea
Posts: 1620
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Library Path Problem

Postby badidea » Nov 30, 2019 20:08

I have been using linux and freebasic for almost 10 years now, but I have never tried to compile fbc itself.
I just run the install script which puts fbc in /usr/local/bin and include files like string.bi in /usr/local/include/freebasic and some libraries in /usr/local/lib/freebasic and it works.
storm5510
Posts: 20
Joined: Nov 28, 2019 15:47

Re: Library Path Problem

Postby storm5510 » Dec 01, 2019 1:32

badidea wrote:I have been using linux and freebasic for almost 10 years now, but I have never tried to compile fbc itself.
I just run the install script which puts fbc in /usr/local/bin and include files like string.bi in /usr/local/include/freebasic and some libraries in /usr/local/lib/freebasic and it works.


I started over, following your example. I ran the script. I have four folders under the parent. These folder are "bin" "include" "lib" and "man."
I cannot specify the parent because this editor changes the name. How about "f" + "basic" concatenated.

So, I run the compiler, like this, from the "bin" folder:

./fbc test.bas -e and I get ld: cannot find -lncurses

I enter ld -help and I get an extremely long output. Quickly browing, it seems to have something to do with libraries. It did not make a direct library reference because I copied "string.bi" to the same folder as the compiler, perhaps. Next?

========================

Edit: After some searching on Ubuntu's web site, I found the problem. I needed to build a library. Problem solved.
D.J.Peters
Posts: 7858
Joined: May 28, 2005 3:28

Re: Library Path Problem

Postby D.J.Peters » Dec 01, 2019 2:39

In case of the C runtime try:

#include "crt/string.bi"

Joshy
srvaldez
Posts: 2160
Joined: Sep 25, 2005 21:54

Re: Library Path Problem

Postby srvaldez » Dec 01, 2019 10:56

@storm5510
your way of installing FreeBasic and trying to make it work is unnecessarily complex, here's how I would do it
install FB via the shell script: sudo sh install.sh -i
then install the necessary libraries
sudo apt-get install libncurses-dev
sudo apt-get install libx11-dev
sudo apt-get install libxext-dev
sudo apt-get install libxpm-dev
sudo apt-get install libxrandr-dev
sudo apt-get install libgpm-dev
that's probably enough libraries, now get geany
sudo apt-get install geany
geany is a multi-language IDE that also works with FB, simply compile and then run your program
badidea
Posts: 1620
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Library Path Problem

Postby badidea » Dec 01, 2019 14:04

See also the 'readme.txt' that comes with the fbc download.
storm5510
Posts: 20
Joined: Nov 28, 2019 15:47

Re: Library Path Problem

Postby storm5510 » Dec 01, 2019 16:09

srvaldez wrote:@storm5510
your way of installing FreeBasic and trying to make it work is unnecessarily complex, here's how I would do it
install FB via the shell script: sudo sh install.sh -i
then install the necessary libraries
sudo apt-get install libncurses-dev
sudo apt-get install libx11-dev
sudo apt-get install libxext-dev
sudo apt-get install libxpm-dev
sudo apt-get install libxrandr-dev
sudo apt-get install libgpm-dev
that's probably enough libraries, now get geany
sudo apt-get install geany
geany is a multi-language IDE that also works with FB, simply compile and then run your program


All I needed was libncurses-dev. I ran it exactly as you have it above.

I have been writing my test programs on my Window 10 system, and then taking them to the Linux machine and compiling them there. I wondered about the program syntax, but there was no problem. They run fine.

As for the install, I removed everything and then ran the script. No path problems after that.
srvaldez
Posts: 2160
Joined: Sep 25, 2005 21:54

Re: Library Path Problem

Postby srvaldez » Dec 01, 2019 16:29

I am glad it's working for you
I mentioned the geany IDE because that's the one I am familiar with, but I think there's another cross-platform IDE called poseidon, you can find it the projects section

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest