ipatix/agbplay

Compiling on Mac OS

Closed this issue · 4 comments

yopox commented

Did someone manage to compile agbplay on Mac OS ?

I installed the following dependancies with Homebrew : boost, portaudio, ncurses, and libsndfile.

When I tried to compile, I got the following error :

[Compiling] obj/CGBChannel.o
[Compiling] obj/CGBPatterns.o
[Compiling] obj/ConfigManager.o
[Compiling] obj/ConsoleGUI.o
src/ConsoleGUI.cpp:57:26: error: invalid operands to binary expression ('agbplay::Color' and 'int')
        wattrset(winPtr, COLOR_PAIR(Color::WINDOW_FRAME) | A_REVERSE);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/curses.h:1005:23: note: expanded from macro 'COLOR_PAIR'
#define COLOR_PAIR(n)   NCURSES_BITS(n, 0)
                        ^~~~~~~~~~~~~~~~~~
/usr/include/curses.h:879:42: note: expanded from macro 'NCURSES_BITS'
#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT))
                                  ~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:5278:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:3931:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os,
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/bitset:1091:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x);
^
src/ConsoleGUI.cpp:59:26: error: invalid operands to binary expression ('agbplay::Color' and 'int')
        wattrset(winPtr, COLOR_PAIR(Color::DEF_DEF) | A_REVERSE);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/curses.h:1005:23: note: expanded from macro 'COLOR_PAIR'
#define COLOR_PAIR(n)   NCURSES_BITS(n, 0)
                        ^~~~~~~~~~~~~~~~~~
/usr/include/curses.h:879:42: note: expanded from macro 'NCURSES_BITS'
#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT))
                                  ~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:5278:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string:3931:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os,
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/bitset:1091:1: note: candidate template ignored: could
      not match 'basic_ostream<type-parameter-0-0, type-parameter-0-1>' against 'agbplay::Color'
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x);
^
2 errors generated.
make: *** [obj/ConsoleGUI.o] Error 1

I'm using Mac OS Sierra 10.13.5

Which GCC version are you using?

For issues on Mac OS, you might wanna try to ask @easyaspi314 since I know he has been using agbplay on Mac OS.

I personally can't really help with Mac OS itself although I'm pretty sure an explicit cast to "int" from "Color::WINDOW_FRAME" will solve this issue.

Ipatix is right, just cast it to int.

Also, yopox is using Clang, not GCC.

I just pushed 58913e0, can you try if it fixes your issue?

yopox commented

Based on your commit I found other edits. I compiled successfully and pushed PR #14 😺