A 50:50 Ratio Getting PBCompiler to Load So Far

Everything else that doesn't fall into one of the other PB categories.
oldefoxx
Enthusiast
Enthusiast
Posts: 532
Joined: Fri Jul 25, 2003 11:24 pm

A 50:50 Ratio Getting PBCompiler to Load So Far

Post by oldefoxx »

I'm learning some important things about PureBasic. I just learned about $HOME+"/.purebasic/purebasic.prefs" (Linux version) where you can get answers about things like window size, files recently accessed, files currently accessed, font used and size, and whether a window is maximized or not. At least as far as the Editor and Debug Output windows are concerned. You can also make changes there, so be cautious. If you screw up, just delete the folder and it's contained files, and on the next load, the IDE will regenerate it. But you lose your custom settings, so might be best to back up this folder or these files first before tweaking them directly. This file also has $HOME and the current path in it.

But since I upgraded to 5.40, I've had two of four installs of PureBasic report that the compiler did not load when I tried to compile and run an example program. This is for three partitions on my old laptop and one on my new. Three are 64-bit versions of Ubuntu and one 32-bit version. One of the failures was the 32-bit version, so it is not specific to the compressed file I used. Once I reach that failure point, I get the same failure when I try to rename the parent folder for purebasic (now purebasic.old) and delete .purebasic and re-extract the compressed tgz file, or when I try to revert to 5.31. Wherever the impact happens, it is apparently not in these areas. It could be at the root level. Let me try that real quick.

Code: Select all

sudo updatedb;  sudo locate purebasic > 1.tmp; sort -n 1.tmp > 2.tmp; cat 2.tmp | less
No, walking the paths returned, I only find two folders involved. But that does not preclude a bad reference to a path statement where purebasic tries to load pbcompiler, and that would be internal to some file. So let's see if I can find where "/pbcompiler" is used.

This searsh has been going on for hours, and could take hours more. So to bring an end to this post, let's just say that I want to know why the IDE complains the compiler isn't getting loaded, and what I can do about it.
has-been wanna-be (You may not agree with what I say, but it will make you think).
oldefoxx
Enthusiast
Enthusiast
Posts: 532
Joined: Fri Jul 25, 2003 11:24 pm

Re: A 50:50 Ratio Getting PBCompiler to Load So Far

Post by oldefoxx »

Correction: The problem is not resolved. I've tried everything I can think of to get the two failed partitions to work, even copying everything from one account over onto another with a forced replace, and the failed partitions' IDEs just keep reporting that the compiler failed to load, suggesting that I try again. I downloaded the very latest upgrades during the night when doing this, and nothing helps. What is it that takes root in the partitions that fail that replacing the user account does not fix? I have only two courses left it seems, or three:
(1) Try setting up a different account and see if that makes a difference when I install PureBasic to it.
(2) Wipe my present account and start it over
(3) Wipe the partition and reinstall from scratch

Whatever it is, it does not seem to be in the account itself. It must be the way something got rigged up in one of root's folders or files. In which case, option (3) may be the only one that works. unless someone can tell me where the problem might be. I don't know where to look. What I really need is a tool to rid the partition of everything PureBasic did once it installed so that I can just start over with a clean slate.
has-been wanna-be (You may not agree with what I say, but it will make you think).
oldefoxx
Enthusiast
Enthusiast
Posts: 532
Joined: Fri Jul 25, 2003 11:24 pm

Re: A 50:50 Ratio Getting PBCompiler to Load So Far

Post by oldefoxx »

Knowing the problem was not in the /home tree, I finally decided to junk my 32-bit OS and upgrade to 64-bit. I even went so far as to reformat the partition, giving up what I had in the account. When I do the next partition, I will see about saving the accounts by first doing a sudo rm -r media/ubuntu/sda2/[!h]* in the LiveCD Terminal window. I will mount the partition in the GUI before entering the terminal mode.

And I am glad to say that a fresh install of PureBasic is actually working there. But there seems to be a linker problem with some of the example programs. I get a message that /usr/bin/ld: cannot find -|x11. Some online searches turn up that the -|x11 is a shorthand way of identifying a missing libx11.so file. And a find / -name *libx11.so* confirms there is nothing close to that to be found.

So I checked the install of PureBasic on /sev/sda1, and there is no file by that name there either. So I rebooted to /dev/sda1 and tried the same program there. I get a much more detailed message, but it seems to be the same problem. Here is a link to a screenshot of the message I got: https://my.pcloud.com/publink/show?code ... 4kuu5zwhNy

Now what is it that I need in order to get these programs to run? Exactly what do I have to tell spt-get to install for me?
has-been wanna-be (You may not agree with what I say, but it will make you think).
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: A 50:50 Ratio Getting PBCompiler to Load So Far

Post by c4s »

Just a wild guess as I don't use Linux: As far as I know there is some kind of dependency checker and/or installer script in the main directory of PB (for Linux). Did you already try it?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
oldefoxx
Enthusiast
Enthusiast
Posts: 532
Joined: Fri Jul 25, 2003 11:24 pm

Re: A 50:50 Ratio Getting PBCompiler to Load So Far

Post by oldefoxx »

No, I hadn't. I just did, and found a few missing dependencies, and that's been rectified. Since this is a script file, all it really needs is to change this:

Code: Select all

echo "# apt-get install gcc g++ libc6-dev libsdl1.2-dev libgtk-3-dev unixodbc-dev libgnome2-dev libxine-dev libxxf86vm-dev"
to this:

Code: Select all

sudo apt-get -y install gcc g++ libc6-dev libsdl1.2-dev libgtk-3-dev unixodbc-dev libgnome2-dev libxine-dev libxxf86vm-dev
They could even stick a "-qq" in there with the "-y" and avoid looking at sceens of messages that happen to fast to be read anyway. Or they could use this instead:

Code: Select all

sudo apt-get -y install gcc g++ libc6-dev libsdl1.2-dev libgtk-3-dev unixodbc-dev libgnome2-dev libxine-dev libxxf86vm-dev > tmp.txt; echo "           Use arrow keys to scroll, then press "\"q\" to end this view. >> tmp.txt; cat tmp.txt | less; rm tmp.txt
Might seem mighty dumb on my part not to have bothered reading the README file, but so many of them have so little to say, and you get use to just passing over them and going right to the installer. A better name could be used, like MUSTREAD or README_1st.

Anyway, thanks for the tip. The only problems with a shell script are:
(1) Has to have file permissions set as executable.
(2) If done from the Desktop, Folder permissions have to be set to execute executable (script) files from within the File Manager
(3) If done from a Terminal, you have a series of commands that have to be done to get the script file to run:
locate checkinstall.sh # then press Enter. Don't type the # or anything after it.
# copy this whole path to the clipboard by highlighting it with the mouse and shift key, then using Shift+Ctrl+C.
chmod +x # then paste the clipboard after the "+x " using Shft+Ctrl+V. Then press Enter.
# Then do a Shft+Ctrl+V on the new line like this:
Shft+Ctrl+V # and press Enter again. That will do it. It simplifies to three steps:
(1) locate the file
(2) Make it executable
(3) Execute it.

Now if locate did not find the file, that's due to the fact that your databases have not been updated yet to reflect its presence. So before you try to repeat the steps, you need to get the databases current. And you do that with this command: sudo updatedb. In fact, you could modify (1) to read this way: sudo updatedb; locate checkinstall.sh

Locate is a great little command, and it matches for any part of a path or filename. It acts like FindString() or InStr() does when it comes to searching certain system databases for matching paths/filenames.
has-been wanna-be (You may not agree with what I say, but it will make you think).
oldefoxx
Enthusiast
Enthusiast
Posts: 532
Joined: Fri Jul 25, 2003 11:24 pm

Re: A 50:50 Ratio Getting PBCompiler to Load So Far

Post by oldefoxx »

I went ahead and reworked the checkinstall.sh script file for Linux. Here it is:

Code: Select all

#!/bin/bash

echo ""
echo "  This script will ensure that all needed developments packages are installed"
echo "             if you are using a Debian or Ubuntu like distribution:"
echo ""
echo "" > tmp.txt
echo "    Use up/down arrow and Page keys to scroll, then "\"q\" key to quit view.>> tmp.txt
echo "" >> tmp.txt
sudo apt-get -qq update
sudo apt-get -qq -y dist-upgrade
sudo apt-get -y install gcc g++ libc6-dev libsdl1.2-dev libgtk-3-dev unixodbc-dev libgnome2-dev libxine-dev libxxf86vm-dev >> tmp.txt
sudo apt-get autoremove >> tmp.txt
echo "" >> tmp.txt
echo "    Use up/down arrow and Page keys to scroll, then "\"q\" key to quit view.>> tmp.txt
echo "" >> tmp.txt; cat tmp.txt | less; rm tmp.txt
echo "" 

PAU=0

# Check for gcc
which gcc >/dev/null
if [ $? -ne 0 ]; then
  echo "gcc not found."
  echo "gcc package need to be installed to use PureBasic"
  PAU=1
fi

# Check for libstdc++
echo "int main() { return 0; }" > pbtest.c
gcc pbtest.c -lstdc++ -o pbtest.out 2>/dev/null
if [ $? -ne 0 ]; then
  echo "libstdc++ not found."
  echo "libstdc++ devel package need to be installed to use PureBasic"
  PAU=$((PAU+2))
fi
rm -f pbtest.c pbtest.out

# Check for GTK
pkg-config --cflags gtk+-3.0 >/dev/null
if [ $? -ne 0 ]; then
  echo "gtk+ 3.0 devel package need to be installed to use PureBasic"
  PAU=$((PAU+4))
fi

pkg-config --cflags libgnome-2.0 >/dev/null
if [ $? -ne 0 ]; then
  echo "libgnome devel package need to be installed to use PureBasic"
  PAU=$((PAU+8))
fi

# Check for LibXine
pkg-config --cflags libxine >/dev/null
if [ $? -ne 0 ]; then
  echo "xine devel package need to be installed to use PureBasic"
  PAU=$((PAU+16))
fi

# Check for xf86 video extension
pkg-config --cflags xxf86vm >/dev/null
if [ $? -ne 0 ]; then
  echo "xxf86vm devel package need to be installed to use PureBasic"
  PAU=$((PAU+32))
fi

# Check for SDL
which sdl-config >/dev/null
if [ $? -ne 0 ]; then
  echo "sdl-config not found."
  echo "SDL 1.2 devel package need to be installed to use PureBasic"
  PAU=$((PAU+64))
fi

# Check for unixodbc
echo "int main() { return 0; }" > pbtest.c
gcc pbtest.c -lodbc -o pbtest.out 2>/dev/null
if [ $? -ne 0 ]; then
  echo "unixodbc not found."
  echo "unixodbc devel package need to be installed to use PureBasic"
  PAU=$((PAU+128))
fi
rm -f pbtest.c pbtest.out

exit $PAU
has-been wanna-be (You may not agree with what I say, but it will make you think).
chris_b
Enthusiast
Enthusiast
Posts: 103
Joined: Sun Apr 27, 2003 1:54 am

Re: A 50:50 Ratio Getting PBCompiler to Load So Far

Post by chris_b »

oldefoxx wrote:I've had two of four installs of PureBasic report that the compiler did not load when I tried to compile and run an example program.
It might not be the same issue, but whenever I get a "compiler not loaded" type of message clicking Compiler -> Restart Compiler sorts it out.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: A 50:50 Ratio Getting PBCompiler to Load So Far

Post by IdeasVacuum »

Not seen this issue until 5.40LTS, so something is not right in 5.40 that was OK in 5.31. On Windows, Compiler -> Restart Compiler fixes the issue as chris_b commented.

Of course, it's more complicated on Linux since there are many different 'distros'. Seems that you are OK now that all dependencies are in place.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply