I have a C++ application using the QT framework. I'm trying to add an option for the user to be able to set the program to start automatically on startup.
My development machine is running OS X 10.6.
As my main Mac reference, I'm using this Apple documentation. According to the documentation, there are two recommended ways of doing this. One is to use the Cocoa Shared Files List API, which works only on OS X 10.5 or higher. The other is to use the Carbon Apple Events API, which while not explicitly stated in the documentation, from my readings appears to work only on OS X 10.5 or lower.
According to this QT documentation I should be able to do this. However, I can't seem to figure out how to make either of these methods work.
For the Cocoa Shared Files List API, I followed the suggestions from this answer, but I can't seem to figure out what files to include that will get this working in my project. Things like LSSharedFileListRef are undefined. Is what I'm trying to do even possible from C++?
For the Carbon Apple Events API, I tried using the code that comes from Apple's own example. However, including doesn't seem to define all the things I need like all the examples online seem to suggest. For example, DescType is undefined, and the examples don't work. Is this because I'm on OS X 10.6?
Overall, what can I do to get my program to start on boot, ideally supporting all Macs OS X 10.4 and up?