Page 1 of 1

pasmo won't compile on my mac

Posted: Tue Apr 16, 2024 8:08 pm
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!

Re: pasmo won't compile on my mac

Posted: Tue Apr 16, 2024 8:44 pm
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/

Re: pasmo won't compile on my mac

Posted: Tue Apr 16, 2024 9:04 pm
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

Re: pasmo won't compile on my mac

Posted: Tue Apr 16, 2024 9:13 pm
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!

Re: pasmo won't compile on my mac

Posted: Tue Apr 16, 2024 9:33 pm
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.

Re: pasmo won't compile on my mac

Posted: Wed Apr 17, 2024 12:11 am
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

Re: pasmo won't compile on my mac

Posted: Wed Apr 17, 2024 8:36 pm
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: