jmoon018 / PacVim

GNU Lesser General Public License v3.0
3.24k stars 193 forks source link

OS X support? #8

Closed eveliotc closed 9 years ago

eveliotc commented 9 years ago

Trying to build it on OS X (C++ ignorant), not sure how to get around curses headers not being found, help pls

roryokane commented 9 years ago

I can’t build PacVim on OS X 10.9 either. Here are more details to help with debugging.

The full output of make:

$ make
g++ -w src/game.cpp -pthread -std=c++11 -lncurses src/globals.cpp src/helperFns.cpp src/avatar.cpp src/ghost1.cpp -o pacvim
In file included from src/game.cpp:10:
src/globals.h:6:10: fatal error: 'cursesw.h' file not found
#include <cursesw.h>
         ^
1 error generated.
In file included from src/globals.cpp:1:
src/globals.h:6:10: fatal error: 'cursesw.h' file not found
#include <cursesw.h>
         ^
1 error generated.
In file included from src/helperFns.cpp:1:
src/globals.h:6:10: fatal error: 'cursesw.h' file not found
#include <cursesw.h>
         ^
1 error generated.
In file included from src/avatar.cpp:1:
In file included from src/avatar.h:8:
In file included from src/helperFns.h:4:
src/globals.h:6:10: fatal error: 'cursesw.h' file not found
#include <cursesw.h>
         ^
1 error generated.
In file included from src/ghost1.cpp:1:
In file included from src/ghost1.h:4:
In file included from src/avatar.h:8:
In file included from src/helperFns.h:4:
src/globals.h:6:10: fatal error: 'cursesw.h' file not found
#include <cursesw.h>
         ^
1 error generated.
make: *** [all] Error 1

I asked the Homebrew package manager whether curses was already installed. It said ncurses is built-in to OS X:

$ brew info ncurses
ncurses: stable 5.9
http://www.gnu.org/s/ncurses/

This formula is keg-only.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Not installed
From: https://github.com/homebrew/homebrew-dupes/blob/master/ncurses.rb
==> Options
--universal
    Build a universal binary

I tried installing it anyway with brew install ncurses, which uses this Homebrew formula. But make gave the same errors afterward.

woodjuice commented 9 years ago

I got the same problem as above, and my operation system is OS X 10.10

When I tried brew install ncurses, it returned:

$ brew install ncurses
Error: No available formula for ncurses
Searching formulae...
Searching taps...
homebrew/dupes/ncurses
jmoon018 commented 9 years ago

The main repo has been updated, and I tested it on OS X 10.10.1 (it worked)

Update your repo and checkout the README again -- it will have the new installation instructions. It should fix the dependency issue and more. Checkout #9 for more info.

If this does not work still, let me know: @woodjuice @roryokane @eveliotc

manonthemat commented 9 years ago

I got the same output @woodjuice. I then ran

brew install homebrew/dupes/ncurses

which installed and configured ncurses-5.9 for me. You still have to link it for the compiler. That's what

brew link ncurses --force

is for.

Then a

make

in the git repository should do the trick.

bfontaine commented 9 years ago

The repo should build fine on OS X now, using OS X’ preinstalled curses library.

eveliotc commented 9 years ago

All good here @jmoon018 thanks!

woodjuice commented 9 years ago

Everything is ok now. Thx! @jmoon018

jmoon018 commented 9 years ago

Glad it works. Thanks for confirming @woodjuice