pasmo won't compile on my mac

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
LunarWilly
Drutt
Posts: 4
Joined: Fri Apr 05, 2024 12:38 pm

pasmo won't compile on my mac

Post by LunarWilly »

Just downloaded pasmo 0.5.5 and it doesn't seem to want to compile on my mac running 12.7.4. Most of the errors seem to come from this file

Code: Select all

asm.cxx:4483:14: error: expression is not an integral constant expression
        case Arit16Code::codeSBCHL:
Does anyone have any suggestions on how to get this building? Cheers!
User avatar
ParadigmShifter
Manic Miner
Posts: 673
Joined: Sat Sep 09, 2023 4:55 am

Re: pasmo won't compile on my mac

Post by ParadigmShifter »

Are you using an old C++ compiler which doesn't support C++11 enum class?

Code: Select all

enum class Arit16Code : byte
{
    codeADDHL = 0x09,
    codeADCHL = 0x4A,
    codeSBCHL = 0x42
};
is the definition of the enum.

You might be able to remove enum class and replace it with an enum but that may affect how the opcodes are emitted since that's also telling the compiler it is of type byte (which is also fairly new, may be C++11 as well?).

Otherwise you may need to just turn on C++11 support on the compiler if it isn't on by default?

Luckily I haven't had to program in C++ for ages ;)

Is that the FIRST error in the file (first error is the most important one, fix the errors in order they appear)? Or do you also get an error on the enum class declaration line?

EDIT: Details about enum class here

https://www.geeksforgeeks.org/enum-clas ... -datatype/
LunarWilly
Drutt
Posts: 4
Joined: Fri Apr 05, 2024 12:38 pm

Re: pasmo won't compile on my mac

Post by LunarWilly »

Fixed! I had to set the c++ compiler standard flag using

Code: Select all

./configure CXXFLAGS=-stdc++17
Cheers for your help :D
User avatar
ParadigmShifter
Manic Miner
Posts: 673
Joined: Sat Sep 09, 2023 4:55 am

Re: pasmo won't compile on my mac

Post by ParadigmShifter »

No probs.

Problem with C++ and it's many many dialects now available is that they are all trying to make an octopus by nailing 4 extra legs onto a dog ;)

EDIT: 666th post and it's fitting it should be about C++ lol ;) Truly the devil's programming language!
LunarWilly
Drutt
Posts: 4
Joined: Fri Apr 05, 2024 12:38 pm

Re: pasmo won't compile on my mac

Post by LunarWilly »

Ha! Congrats on the diabolical post. It seems every time I encounter a makefile, it seems to transport me to hell, so quite apt really.
User avatar
TomD
Manic Miner
Posts: 379
Joined: Tue Nov 13, 2018 9:47 am
Location: Leeds UK
Contact:

Re: pasmo won't compile on my mac

Post by TomD »

LunarWilly wrote: Tue Apr 16, 2024 9:04 pm Fixed! I had to set the c++ compiler standard flag using

Code: Select all

./configure CXXFLAGS=-stdc++17
Cheers for your help :D
I had the same issue so thanks for posting as this also solved it for me. One small change is you've missed the = after std.

Code: Select all

 ./configure CXXFLAGS=-std=c++17
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
XoRRoX
Manic Miner
Posts: 233
Joined: Wed Jul 11, 2018 6:34 am

Re: pasmo won't compile on my mac

Post by XoRRoX »

LunarWilly wrote: Tue Apr 16, 2024 9:33 pm Ha! Congrats on the diabolical post. It seems every time I encounter a makefile, it seems to transport me to hell, so quite apt really.
Diablocical? :evil:
Post Reply