开发者

Qt Installation Problems on Mac OS X

Over the past 2 years I've had to install Qt 4.5, 4.6 and now 4.7 from source on Mac OS X. Each install causes me no end of trouble. My 2 main issues are:

  • I build Qt in /tmp/ as instructed to. This directory gets wiped clean on a reboot, and stops me from being able to step through Qt code. I've got round this by building in my Users area instead.
  • Every time I blow on my monitor, I can no longer see the values of QStrings (or any other kind of string for that matter) when debugging my application.

First I'd like to know what Qt files I should have on my machine and where, when correctly installed. My 'official' installs are in /usr/local/Trolltech, but everything's duplicated in my ~ directory so that I can step through Qt code. I'm sure I'm doing something wrong, as the only other mention of this anywhere is a stackoverflow question that I raised myself.

Also, how do I use Qt frameworks in my Xcode projects? I tried the following:

  • Dragging the frameworks from my ~ directory, knowing this was probably wrong.
  • Right clicking in Xcode and Add->Existing Frameworks... There used to be some Qt frameworks listed there, but I manually deleted them in Finder prior to installing 4.7 and they never came back.
  • Adding -framework QtCore to Xcode's Other Linker Options and /usr/local/Trolltech/Qt-4.7.1 to Xcode's Framework Search Path.

The last bullet fixes my linking errors, but I'm assuming I should be able to see Qt frameworks in th开发者_运维知识库e list of available frameworks (both in Xcode and About This Mac->Software->Frameworks).

A separate issue I guess, but having got that far, my data formatters in Xcode broke yet again. Where should my data formatter bundle be located in Xcode 3.2.3 and what should the function look like for QStrings?

Any help much appreciated. Thanks.


I use Qt Creator instead of Xcode with Qt. So I can't help you on the Xcode project part. But I do have some success on building Qt with debug information. Unzip Qt source to some place that won't get wipe out like /qt. This is the steps I use to build it:

cd /qt
./configure -prefix '.' -opensource -confirm-license -debug-and-release
make -j4
make docs

-j4 is just to make it build 4 jobs simultaneously. You don't really need that. Then don't do make install. This will leave the built libraries and frameworks in the source directory. It's needed to be able to step into Qt's own source. When installed in a different directory, Qt lose link to its own source files.

Debugging on the Mac is still hit and miss. I don't know what can be done to improve it. Apple's version of gdb is kind of behind so maybe that is why.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜