I want to use the new C++ OpenCV interface to create Qt applications in Qt Creator on OS X Snow Leopard. How can I do this? Good explanations of this are very hard to come by online.
-
First of all, welcome to stackoverflow. Next, to the business side of things -- it may be worth rephrasing your question in a more specific way. Right now, it just sounds like you're asking people to write (or find) a HOWTO for you. What have you actually tried? What doesn't work as you expected? – mpenkov Sep 13 '11 at 16:45
-
Agreed witg misha. Moreover you scared the * out of me. I want to do exactly this, this weekend, and you made me believe it might have been a terrible path to take. Anyhow: first install xcode, then you have make and gcc, then install macports, then you have port, then: http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port . Morover, the qt-website offers an pkg, which is probably just click and play (You could have at least tried this, right ;)). One problem you may encounter is that xcode isn't (easily) available to snow leopard anymore, my solution was to spend some money on lion. GL! – Herbert Jun 07 '12 at 10:24
-
btw, if I'm done, I will post an answer if not already done. Feel free to poke me if I forget. – Herbert Jun 07 '12 at 10:27
-
Since I answered the question you felt worth asking with something that took me some time to document and write down in 2 days, could you please either add a comment on what you do not understand or disagree with, or accept it? Thanks in advance. – Herbert Jun 20 '12 at 10:32
1 Answers
I actually did this, and it was fairly easy. You can download QtSDK from the qt-website as a dmg, installing that is just click-and-play.
After this I used MacPorts, MacPorts is a package-manager (like aptitude, portage, pacman, etc) for osx. http://www.macports.org/, download it, and again: click-and-play.
To use MacPorts, you first need tools like make and gcc/g++ to work. These are included in the package xcode (which is in the apple store). Of course, these tools are as important as a cpu to a developer. You would want them in the first place.
After installing xcode, make/g++/gcc are on your system, yet they are not in your path. In a terminal, the commands won't exist. To fix this, open the xcode ide (If I am allowed to call it an ide, am I?). Then goto XCode (lop left screen)-> Preferences -> Downloads. There you can install the 'Command Line Tools', do this.
Then make should be there. Use a terminal to verify. Just typing make will probably message you 'make: * No targets specified and no makefile found. Stop.', but not 'command not found'.
Then, to install opencv I installed MacPorts, type 'sudo port install opencv', wait a while and if all went well, you should have opencv. It is installed in /opt/local. Therefore you might need to add these to your .pro-file:
CONFIG += MYHOTOSXMACHINE
MYHOTOSXMACHINE {
INCLUDEPATH += /opt/local/include/
LIBS += -L/opt/local/lib/
}
So, there you go. Good luck!
PS: I not new to the whole linux/gnu/posix thing, yet I am new to osx. So if there is a cleaner way to do this, feel free to comment.

- 5,279
- 5
- 44
- 69