Tricky Mac Issues

Tricky Mac Issues

Problems for Other Systems


This document provides a quick summary of some tricky C++ errors on a Mac and how to fix them



libc++abi.dylib:

Useless Mac Error

This means that there's an error in your code (an unhandled exception, specifically).

To get more information about the error you need to run your code in a debugger. Instead of clicking on the green arrow (Command + R) to run your program, click on the green arrow with a bug on it (Command + Y).

When your program encounters the error which caused the problem in the first place, you'll be placed in a debugger looking at the exact moment the crash occured.



Undefined Symbol(s)

Mac Undefined Symbol(s) Error

This means that you tried to use a function you didn't define. Often times, this is because of a difference between the parameters or return type in the function prototype and function definition.

To get more information about the error, click on the "Compile Output" tab and scroll up:

Mac Undefined Symbol(s) Error with more info

This tells you that you referenced the undefined "foo()" function inside of the main function.



No debugger set up

No debugger set up

This error usually shows up if you've installed Xcode 5 instead of Xcode 4.6.3. Apple completely removed GDB from Xcode 5, so you have to use the new LLDB instead. Future versions of Qt Creator will detect this automatically, but Xcode 5 was released quite recently, so for now we have to fix this manually:

To fix the issue, click Qt Creator => Options => Build & Run => Kits. Click on the auto-detected kit => click clone => make default. Find the line which says debugger, and click edit. Change the selection from "GDB engine" to "LLDB engine", and type in "/usr/bin/lldb" in the text box.

Fix debugger set up

Once you finish doing that, you'll need to close Qt Creator. Go to the directory where you keep your assignment, and delete all files ending in ".pro.user". Then, click on the .pro file and you can reconfigure your project with the debugger ready to go.