Hacker News new | ask | show | jobs
by skittles 4454 days ago
Anyone know why clang on mac os x doesn't know about edit/history.h? The line editing portion of the book requires it.
2 comments

You can try to install with MacPorts Readline with terminal command: sudo portu install readline

And after that you include with #include <readline/read line.h> #include <readline/history.h>

That would be for libedit: http://thrysoee.dk/editline/
I've installed this, but I still get this error:

fatal error: 'editline/history.h' file not found

Any advice would be greatly appreciated.

Are you using Mavericks? You need to import the library using #include <histedit.h>.

Other problem is that the code won't work with this library. You need to rework it using the following example: http://www.cs.utah.edu/~bigler/code/libedit.html

There's a lot more to set up and tear down when using the Mavericks' editline; it's not so user-friendly for a beginner as the code in the example.