geany_run_script.sh not given execute permission [SOLVED]

Please post any bugs you have found
Message
Author
User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

the error code

#16 Post by sfoster »

The error message without the -e bash -c option is as follows:

Code: Select all

/usr/share/freebasic/bin/linux/ld: cannot find -lc 
With "-e bash -c"code inserted it is still the same. I didn't get the opportunity to see this code in the new version because of the ghosted button.
I should have the opportunity to experiment with it more this weekend. I'll keep posting.
Yours,
S

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#17 Post by npierce »

sfoster wrote:

Code: Select all

/usr/share/freebasic/bin/linux/ld: cannot find -lc
This error message indicates that the file libc.so cannot be found. Typically that would be in the /usr/lib/ directory, but since it isn't usually needed except for development, it was probably omitted from your Puppy.

Since libc.so is missing, it is likely that others are as well. I don't know for sure which are needed, since it only complains when something is missing, but I do know that it complained about the following missing files when I tried fbc on my Puppy 4.3.1:

-lc (libc.so)
-lm (libm.so)
-lpthread (libpthread.so)
-ldl (libdl.so)
-lncurses (libncurses.so)

My guess is that installing the appropriate *devx*.sfs for your Puppy (lupu_devx_500.sfs if you are still using Puppy 5.0.0) will provide these files -- actually 3 symlinks and 2 GNU ld scripts -- as well as 2 other libraries needed by the GNU ld scripts.

But that is just a guess, since I didn't try this myself. I didn't want to download 90 MB just for 12 KB of stuff.

If you plan on doing other development work, you should go ahead and install the *devx*.sfs file. But if you will only be using freebasic and don't want to download 121 MB (for instance, if you were on dial-up), or if installing it doesn't solve the problem, let me know and I can tell you what I did manually for my Puppy 4.3.1.

Should you decide to try the manual solution, please post the output of the following commands, so we can adapt the procedure to your Puppy:

Code: Select all

find / -xdev  -name libc.so -ls -o -name libm.so -ls -o -name libpthread.so -ls -o -name libdl.so -ls -o -name libncurses.so -ls

find / -xdev  -name libc.so.? -ls -o -name libm.so.? -ls -o -name libpthread.so.? -ls -o -name libdl.so.? -ls -o -name libncurses.so.? -ls
(Note that the two commands are long, and the lines may wrap in your browser window, but they are really only one line each.)

Now, having said all of that, I do see a bit of a mystery here:
sfoster wrote:. . . but I did try compiling code from inside the terminal just to see if the problem was Freebasic's (from earlier), and that worked. It made a binary just fine.
Really? No error messages? Did the binary run okay? Can you think of anything that was different other than you were compiling in the terminal instead of in geany? Perhaps you had the *devx*.sfs file installed?

It surprises me that the loader would give that error when run from geany but not when run from a terminal. But if it does, all that I said about installing the *devx*.sfs file may not help you here. Although it still might be helpful to see the output of the two commands I suggested above.

(Oh, wait, I think maybe I see. You tried geany without your pup-save. So maybe you'll be fine with your pup-save.)

sfoster wrote:Oh, I should also mention before I sign off that the file was actually named hi.bas. I think bash just didn't print the file extension for some reason when it was relaying the message back to me. I think the new version does recognize .bas files because in one of the lower windows immediately below the editing pane, it says "file type: Freebasic."
Ah, thanks for reporting that it was recognized okay. That eliminates one possibile problem.

(By the way, bash didn't print the file extension in the error message because it was looking for the executable, which has no extension.)

I installed the new version of geany and played with it a bit. It appears that for some reason it cannot properly set the source file commands (such as the compile command). If you choose the last entry of the Build menu (can't think of its name at the moment) you will see that the new version leaves the source file commands blank. This seems to be true for other file types as well, not just freebasic. Although you can fill it in yourself (fbc -w all "%f") I would suggest sticking with the old version for now, in case there are similar bugs lurking in the new version (although I was able to get it to work, after filling in the command).

Good luck. Please keep us posted on your progress.

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

partially solved

#18 Post by sfoster »

The devx file turned out to be the missing link. When you mentioned looking for other details, it suddenly occurred to me that I had been working across several different pup-save files. The only things I had thought to check for was the version number of Geany, and to make sure that the Freebaisc PET was installed. I have an up-to-date copy of the developer module that corresponds with my version, but I guess I didn't have it properly installed on all of the saves that I was using. I hope I didn't send you on any wild goose chases as a result of my error. I reinstalled the old Geany and made sure devx was installed this time, and bingo, it compiled and is working properly. Regarding the other problem I had about not being able to execute code inside of Geany, I think you provided the solution for that too. When you mentioned that there were no paths set for the compile command in the new version, I looked at the old version to see if maybe it had a similar problem with the execute path. The old version looked like it had the compile path set, but not the execute path. Neither the command "fbc" in the prompt or the manual seemed to reveal anything useful. I can't seem to find what that path should be. May I ask your help again?
I really apologize if I caused you any trouble.
Yours,
S

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#19 Post by npierce »

No apology necessary. User error is always a possibility when troubleshooting a problem. That's how we all learn. (Heck, much of what I know is a result of my errors!) In this case you were reminded of something that you perhaps already knew but forgot: when troubleshooting a problem, it is usually best, if possible, to change just one factor at a time.

I think what you are looking for in order to execute from geany is "./%e" (including the quotation marks). That is what I have at Build -> Set Includes and Arguments -> Execute: in my geany, and it works for me.

I don't know what version you have, but in Puppy 4.3.1 I have:

Code: Select all

# geany -V    
geany 0.18 (built on Aug 28 2009 with GTK 2.14.7, GLib 2.18.3)
The only thing I needed to do to get this version working was to change the command for Terminal, as you described in your first post.

Anyway, I'm glad you got compiling from geany working, and hope that you get execution for geany to work as well.

Norm

User avatar
sfoster
Posts: 42
Joined: Sat 12 Jun 2010, 17:12
Location: Southern California, USA

execute works now

#20 Post by sfoster »

Oh, I think I see. "Execute" in Geany means that it executes binary files that have already been compiled. Its a bit confusing for people who are migrating over from Qbasic (well, at least it was confusing for me). You could use the run command in Qbasic to execute programs without compiling them. I assume this was so people could check their source code without cluttering their hard drives full of buggy executables. That's how I normally use it anyway. Its not a huge difference, but it was a point of confusion for me because I had only ever used the IDE that came with QBasic before. I thought the execute path was incomplete because in the case of the compile path, there were other statements in front of the quotation marks. I guess I still have a lot to learn about jumping to conclusions.
My sincerest thanks for all your help.
Yours,
S

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#21 Post by npierce »

You're welcome.

Yes, I see where it could be a bit confusing. Luckily it has been so long since I used QBasic that I had forgotten its behavior, so made no assumptions about geany.

Norm

Post Reply