beebasm - building

handy tools that can assist in the development of new software
Post Reply
User avatar
JohnCoachWalsh
Posts: 8
Joined: Thu Jan 17, 2019 2:10 am
Location: UK
Contact:

beebasm - building

Post by JohnCoachWalsh »

Hi,

I've just tried to clone/build beebasm, from github, and I get a compile error:

Code: Select all

Compiling ... commands.cpp
commands.cpp: In member function ‘void LineParser::HandlePutFileCommon(bool)’:
commands.cpp:1757:51: error: ‘streampos’ is not a member of ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’}
 1757 |                                         ifstream::streampos p = inputFile.tellg();
      |                                                   ^~~~~~~~~
commands.cpp:1760:66: error: ‘p’ was not declared in this scope
 1760 |                                                 inputFile.seekg( p );
      |                                                                  ^
make[1]: *** [Makefile.inc:227: objects/commands.o] Error 1
make: *** [Makefile.inc:183: objs] Error 2
I tried 3 branches:

Code: Select all

git clone https://github.com/stardot/beebasm/
git clone https://github.com/stardot/beebasm/ proposed-updates
git clone https://github.com/cpu6502/beebasm/ bug-streampos
and I got the same compile error in all 3.

I'm on Linux (Fedora 35, or Debian 10 or 11).

Please can anyone tell me what branch I need, to compile OK?

Thanks,
John.
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: beebasm - building

Post by sweh »

Hmm, works for me...

Code: Select all

% /usr/bin/lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

% git clone https://github.com/stardot/beebasm/
Cloning into 'beebasm'...
remote: Enumerating objects: 1654, done.
remote: Counting objects: 100% (43/43), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 1654 (delta 26), reused 20 (delta 20), pack-reused 1611
Receiving objects: 100% (1654/1654), 4.27 MiB | 19.87 MiB/s, done.
Resolving deltas: 100% (1110/1110), done.

godzilla.pts/2% cd beebasm/src                                                 

godzilla.pts/2% make code
Automatically using platform linux
Making subdirectory ... objects/.
...
Compiling ... commands.cpp
Compiling ... BASIC.cpp
Linking ... ../beebasm

% ls -l ../beebasm
-rwxr-xr-x 1 sweh sweh 314608 Jun 15 13:27 ../beebasm*
Also worked on my CentOS 7 install.

Are you using the native gcc compiler, or an alternative? Do you have CFLAGS or similar set?
Rgds
Stephen
User avatar
tricky
Posts: 7697
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: beebasm - building

Post by tricky »

Last time I went to build it, it failed because my compiler was newer and didn't allow what the old one did. I can't remember if I used an older compiler or fixed the couple of bits it didn't like. Since I'm on Windows and only use Vs,I think I'm in a very small minority.
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: beebasm - building

Post by sweh »

OK, so I created a fresh install of Debian 11. Nice fresh out of the box.

And I got a build error.

The issue I saw there:

Code: Select all

commands.cpp:1757:26: warning: std::ios_base::streampos is deprecated: use 'std::streampos' instead
I was able to get it to compile on Debian 11 by removing "-Werror" from the Makefile so that this just was presented as a warning and didn't break the build.
Rgds
Stephen
SteveF
Posts: 1663
Joined: Fri Aug 28, 2015 9:34 pm
Contact:

Re: beebasm - building

Post by SteveF »

Just FWIW, I think this has come up before - see this issue which links to this issue.

Does anyone feel comfortable coming up with a patch that will probably work on "everything"?

Edit: It might actually be fixed on the proposed-updates branch, I'm not sure. It really would be good to get another "official" release out, I guess.
User avatar
JohnCoachWalsh
Posts: 8
Joined: Thu Jan 17, 2019 2:10 am
Location: UK
Contact:

Re: beebasm - building

Post by JohnCoachWalsh »

I was able to get it to compile on Debian 11 by removing "-Werror" from the Makefile so that this just was presented as a warning and didn't break the build.
Thanks @sweh.

I tried removing the -Werror, but it made no difference for my build.

So I've changed the line of c++ code in commands.cpp:

Code: Select all

					//ifstream::streampos p = inputFile.tellg();
					std::streampos p = inputFile.tellg();
That now lets the code build (I put the -Werror back in).

I don't know c++, so if anyone can comment on if this line change is valid ???

And now I'll be starting to use beedasm for the first time, so I'll assume my code change is working, until I hear otherwise.

Thanks all.
John.
User avatar
JohnCoachWalsh
Posts: 8
Joined: Thu Jan 17, 2019 2:10 am
Location: UK
Contact:

Re: beebasm - building

Post by JohnCoachWalsh »

FYI: I just tried to run beebasm, and I get:

Code: Select all

./beebasm: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./beebasm)
./beebasm: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./beebasm)
User avatar
BigEd
Posts: 6261
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: beebasm - building

Post by BigEd »

Somehow your runtime libraries are older than your build time libraries. (That can happen if you build on one machine and try to run on another. For work purposes, I used to build on the oldest machines.)

Can you run an update on your OS?

In my case, on Ubuntu 18.04, I see

Code: Select all

$ ls -l /lib/x86_64-linux-gnu/libc.so.*
lrwxrwxrwx 1 root root 12 May  3 11:19 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.27.so
$ dpkg -S /lib/x86_64-linux-gnu/libc.so.6
libc6:amd64: /lib/x86_64-linux-gnu/libc.so.6
$ dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version          Architecture     Description
+++-=======================-================-================-===================================================
ii  libc6:amd64             2.27-3ubuntu1.6  amd64            GNU C Library: Shared libraries
ii  libc6:i386              2.27-3ubuntu1.6  i386             GNU C Library: Shared libraries
User avatar
sweh
Posts: 3314
Joined: Sat Mar 10, 2012 12:05 pm
Location: 07410 New Jersey
Contact:

Re: beebasm - building

Post by sweh »

JohnCoachWalsh wrote: Sat Jun 18, 2022 12:24 am FYI: I just tried to run beebasm, and I get:

Code: Select all

./beebasm: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./beebasm)
./beebasm: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./beebasm)
Hmm, https://tracker.debian.org/pkg/glibc says that Debian only comes with glibc 2.31, but your binary is looking for 2.34.

Are you using a custom build of gcc that's pointing to custom library directories? That'd also explain why you're getting different compile errors to what I saw on a fresh Debian 11.

However you might also see a similar error if you compiled on Debian 11 and tried to run it on Debian 10 (which has glibc 2.28 and glibcxx 3.4.25).
Rgds
Stephen
User avatar
JohnCoachWalsh
Posts: 8
Joined: Thu Jan 17, 2019 2:10 am
Location: UK
Contact:

Re: beebasm - building

Post by JohnCoachWalsh »

BigEd wrote: Sat Jun 18, 2022 8:53 am Somehow your runtime libraries are older than your build time libraries. (That can happen if you build on one machine and try to run on another. For work purposes, I used to build on the oldest machines.)
You are corect.

I do have 2 laptops, with different distros on: Debian and Fedora.

So I had compiled on Fedora, and then tried it later on the Debian one.

Thanks.
BobsBoard
Posts: 93
Joined: Sun Sep 30, 2018 4:51 pm
Location: NE Hampshire
Contact:

Re: beebasm - building

Post by BobsBoard »

I hope this post is relavend for my question: How to get BeebAsm built for Windows?

The Beebasm readme.md asks me to download MinGW from (http://www.mingw.org) which is a broken link. Is this now MinGW-64.org ? If so, what do I download from the download page.

The readme.md also asks to install the basic subset of cygwin.org. I have downloaded the setup86_64.exe but no option for a basic setup. Maybe base (38) is the thing, but I dont want to assume that is the same thing.

Many thanks.
BBC-A Issue 3, upgraded to B by me in 1984 with Watford 13 Rom Board and 8271 DFS. BBC B Issue 3 (8271) with 4x28c256 mod. BBC Series 7 with 1770DFS all running SPI-MMC

Hommage to Bob Austin www.youtube.com/watch?t=2206&v=fww2qkKbQ4Y
roganjosh
Posts: 179
Joined: Sat Dec 10, 2016 6:51 pm
Location: W.Yorks
Contact:

Re: beebasm - building

Post by roganjosh »

I just did this today. My browser wasn't keen on that mingw site at all (security warnings). Instead I downloaded it from https://sourceforge.net/projects/mingw/files/

The base (38) is what you need from the cygwin package section. You'll also need to install 'make' .

Don't forget to add the cygwin and MinGW 'bin' directories to your user or system 'Path' environment variable and, at least, close and reopen any terminal windows afterwards (or, to be ultra-sure, reboot).

Alan

EDIT: Corrected incorrect MinGW URL.
BobsBoard
Posts: 93
Joined: Sun Sep 30, 2018 4:51 pm
Location: NE Hampshire
Contact:

Re: beebasm - building

Post by BobsBoard »

Thank-you
BBC-A Issue 3, upgraded to B by me in 1984 with Watford 13 Rom Board and 8271 DFS. BBC B Issue 3 (8271) with 4x28c256 mod. BBC Series 7 with 1770DFS all running SPI-MMC

Hommage to Bob Austin www.youtube.com/watch?t=2206&v=fww2qkKbQ4Y
Post Reply

Return to “development tools”