Just installed... trying to compile... not sure if OK

Linux specific questions.
Cas
Posts: 37
Joined: Jul 07, 2007 6:21
Location: Argentina
Contact:

Just installed... trying to compile... not sure if OK

Postby Cas » Mar 26, 2008 2:37

I am rather new to Linux, let me tell you. I have Ubuntu 6.06LTS. What I did is download the tar.gz file for FreeBASIC 0.18.3b installation. I decompressed it (both through the GUI and console seem to work fine). I got inside the directory and ran:

sudo ./install.sh -i

as instructed by the reamde file. After that, I was able to run the fbc program alone and help came up, but when I try to compile a bas file like this:

fbc myfile.bas

nothing happens... and I mean NOTHING. I had a problem before. Earlier I had downloaded a previous version of FreeBASIC and what I got was different. I was also able to run fbc alone and get help, but at compilation time, I used to get and error telling "-lc not found". Since the moment I overwrote that with the new one, nothing happens.
I am sure I must be doing something wrong, as I don't understand Linux very well. I tried to find an answer without creating a new post, but guys you are much more advanced than I am and I got lost in the posts.

Also I read I can have problems to compile graphics and stuff if I don't download or setup certain libraries. Do I have to do anything else? How exactly do I get the program up and running so that I can start programming everything?

Sorry to make such a general and typical question. I promise I will get better at FreeBASIC for Linux soon. Thanks.[/i]
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Postby sir_mud » Mar 26, 2008 2:40

unless fbc encounters a problem you will get no output from that command. you should check if the myfile executable was created by running "./myfile"
Cas
Posts: 37
Joined: Jul 07, 2007 6:21
Location: Argentina
Contact:

Postby Cas » Mar 26, 2008 2:46

Yes, I checked that. I tried "ls" and the file did not show up. I tried to run it anyway, just in case it had been hidden or something and it did not run. I also tried forcing a filename by typing

fbc myfile.bas -x alternatename

and no output was given... no file created either :(
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Postby sir_mud » Mar 26, 2008 3:51

try adding -v to your fbc command line and post the output in a code block.
Loe
Posts: 323
Joined: Apr 30, 2006 14:49

Postby Loe » Mar 28, 2008 1:20

is myfile.bas in correct path?
Cas
Posts: 37
Joined: Jul 07, 2007 6:21
Location: Argentina
Contact:

Postby Cas » Mar 30, 2008 6:15

Yes, Loe... file was in current directory and I tried it like myfile.bas and ./myfile.bas. Anyway, I did not get any file-not-found message. I will try entering a non-existing filename and see what I get, by the way.
sir_mud... I'm going to try the -v option and post back. Thanks
Cas
Posts: 37
Joined: Jul 07, 2007 6:21
Location: Argentina
Contact:

Checked!!

Postby Cas » Apr 01, 2008 5:05

Well... this is what I got:

- when doing fbc myfile.bas or fbc ./myfile.bas the result is the same: no output and no effect or new file created
- when using a non-existing file as a parameter, fbc reacts immediately telling the file has not been found, so the problem is not about recognizing what has been instructed or where the file is
- running fbc from any directory and calling ./fbc produce the same result. It makes no difference whether we are located on the same directory as the fbc executable or not
- including the -v option (that is, fbc -v myfile.bas) causes the compiler to produce this output:

FreeBASIC Compiler - Version 0.18.3 (12-28-2007) for linux (target:linux)
Copyright (C) 2004-2007 The FreeBASIC development team.

compiling: myfile.bas -o myfile.asm
assembling: as --strip-local-absolute "myfile.asm" -o "myfile.o"


No file is created. Please help :(
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » Apr 05, 2008 4:48

Have a look at the freebasic/bin/linux/ directory, and check the perms on the as, ld and ar binaries, they may not be set to +x, i'm pretty sure that can cause a silent fail.
Cas
Posts: 37
Joined: Jul 07, 2007 6:21
Location: Argentina
Contact:

Found partial solution

Postby Cas » Apr 07, 2008 21:59

The files did already have the +x attribute. I found the first problem, anyway. There was a link for fbc in usr, but none for ar, al, and ld. When I created the links, I got fbc doing some more stuff, but still not file is generated. What I get is:

lucas@ubuntu-lucas:~$ fbc -v myfile.bas
FreeBASIC Compiler - Version 0.18.3 (12-28-2007) for linux (target:linux)
Copyright (C) 2004-2007 The FreeBASIC development team.

compiling: myfile.bas -o myfile.asm
assembling: as --strip-local-absolute "myfile.asm" -o "myfile.o"
linking: -dynamic-linker /lib/ld-linux.so.2 -T "/usr/share/freebasic/bin/linux/elf_i386.x" -s -L "/usr/share/freebasic/lib/linux" -L "./" -L "/usr/local/lib" -L "/lib" -L "/usr/lib" "/usr/share/freebasic/lib/linux/crt1.o" "/usr/share/freebasic/lib/linux/crti.o" "/usr/share/freebasic/lib/linux/crtbegin.o" "myfile.o" "$$fb_icon$$.o" -o "myfile" -( -lfb -lgcc -lc -lm -lpthread -ldl -lncurses -lsupc++ -lgcc_eh "/usr/share/freebasic/lib/linux/fbrt0.o" -) "/usr/share/freebasic/lib/linux/crtend.o" "/usr/share/freebasic/lib/linux/crtn.o"
ld: cannot find -lc


Can you give me a hand with this, please?
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » Apr 08, 2008 0:18

for cannot find -lc, it should be a case of

aptitude install libc6-dev

however, if you don't even have libc6-dev you are probably missing a fair bunch of stuff, i would recommend a line like this, that should cover all or most of what you need for FB

aptitude install libc-dev binutils binutils-dev libncurses-dev xorg-dev build-essential
Cas
Posts: 37
Joined: Jul 07, 2007 6:21
Location: Argentina
Contact:

Postby Cas » Apr 08, 2008 3:50

IT WOOOOOOOOOOOOORKED!!!!!!!!!!!!!!!!!!!!!!!!
THANK YOU!

Just a question... if I make a program, and somebody downloads it.... will they need all this stuff installed on their systems so that they can use my application?

Thanks again.
KristopherWindsor
Posts: 2428
Joined: Jul 19, 2006 19:17
Location: Sunnyvale, CA
Contact:

Postby KristopherWindsor » Apr 08, 2008 3:54

Cas wrote:IT WOOOOOOOOOOOOORKED!!!!!!!!!!!!!!!!!!!!!!!!
THANK YOU!

Just a question... if I make a program, and somebody downloads it.... will they need all this stuff installed on their systems so that they can use my application?

Thanks again.


You can tell by the "dev" in "libc6-dev" that it is only needed for compiling the program.
The end user won't need it. ;-)
tinram
Posts: 88
Joined: Nov 30, 2006 13:35
Location: UK

Postby tinram » Apr 09, 2008 11:50

Have a look at the freebasic/bin/linux/ directory, and check the perms on the as, ld and ar binaries, they may not be set to +x, i'm pretty sure that can cause a silent fail.


Without the permissions set on as, ld, ar there is a silent fail -
only the -r option showed me that FB was doing anything (leaving the ASM file).

Then after setting permissions, I got the -lc error message too.

aptitude install libc-dev binutils binutils-dev libncurses-dev xorg-dev build-essential


Thanks yetifoot, that sorted my installation.

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 2 guests