Sunday, November 24, 2013

Using EasyLogging++ on Apple Mac OSX 10.8.5

To use EasyLogging++ on Apple Mac OSX 10.8.5, you need to add:

-std=c++11 -stdlib=libc++

to your compiler options.

So, for a hello world example paste this into a file hello.cpp:

#include "easylogging++.h"

_INITIALIZE_EASYLOGGINGPP

int main(int argv, const char** argc) {
    LOG(INFO) << "Hello, world";
    return 0;
}


and compile it with:

g++ -std=c++11 -stdlib=libc++ hello.cpp -o hello

Run the program:

./hello

That will give you something similar to:

24/11/2013 11:46:52,297 INFO  [default] Hello, world

Friday, September 6, 2013

Disable "Close Window" (Cmd+W) for iTerm

Searching for this gives several results that didn't satisfy me, e.g.
http://apple.stackexchange.com/questions/44412/disable-command-w-in-the-terminal
(a "global" setting)
or
https://groups.google.com/forum/#!topic/iterm2-discuss/j6UDxO5_CXc
(generally having to confirm the closing)

So I propose this:
Open Preferences>Keys
At the bottom of "Global Shortcut Keys" click "+", then type Cmd-W and leave the default Action "Ignore".
You're set!