No qmake in /bin /sbin /usr/bin /usr/sbin
-
Hi. My application compiles nicely via command line (I'm on OS X 10.4.11). However I cannot get it to build via Xcode due to the following errors in moc files:
#error "This file was generated using the moc from 4.4.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"So, I thought I would try and use qmake to create a new xcode project file via "qmake -spec macx-xcode project.pro" however it seems somehow I don't have qmake built or installed. Not sure how this happened, I've built QT 4.6.3 from the source.
Anyway, can someone help me build & install Qmake? If it isn't obvious already, I'm a n00b.
I've tried CD'ing into the QT source directory, then in the qmake folder and invoking "make" but it just laughs at me and says "make: *** No targets specified and no makefile found. Stop." There is a "Makefile.unix" in there, but I don't know what I'm doing.
Any assistance is greatly appreciated! Thanks in advance.
-
Hi!
After building Qt, qmake and other Qt tools should be in $DIR_WHERE_YOU_BUILT_QT/bin/ .
To use it, you can either add this directory to your $PATH or install it - I am assuming the environment variable is called PATH on OS X too :-P
-
Hey there, thanks for the reply. Ok, so yes, I have qmake in /usr/local/Trolltech/Qt-4.6.3/bin but why then when I run "which qmake" do I get "no qmake in /bin /sbin /usr/bin /usr/sbin"?
Thanks in advance.
-
Also, where would I define the path to qmake, in my .pro file or in my make file?
$PATH=/usr/local/Trolltech/Qt-4.6.3/bin/qmake
Thank you again
-
Hey
well, the command which qmake looks for qmake in the directories listed in $PATH, so as /usr/local/Trolltech/Qt-4.6.3/bin is not in your $PATH variable, it can't find qmake.
To add this path to your $PATH, do something like this:
@
export PATH=/usr/local/Trolltech/Qt-4.6.3/bin/qmake:$PATH
@in a shell. I said 'something like this' because I don't know if it works in the same way on OS X and probably there is another place to set this variable globally for your system (so XCode would find qmake as well).
-
So I gave that a shot and entered "export PATH=/usr/local/Trolltech/Qt-4.6.3/bin/qmake:$PATH" into Terminal.
Then following that I tried to find qmake again via "which qmake" I then got:
no qmake in /usr/local/Trolltech/Qt-4.6.3/bin/qmake /bin /sbin /usr/bin /usr/sbin
Your assistance is greatly appreciated.
-
Ops, I committed a mistake in my last post. You have to set the path to the directory where the binaries are located, so the correct would be:
@
export PATH=/usr/local/Trolltech/Qt-4.6.3/bin/:$PATH
@Sorry about that. Now it may work correctly.
-
Thank you! Working great now, really appreciate your help!
-
A new error has popped up now while trying to build via Xcode, my app builds fine via command line, the new error is:
@ cd /Developer/Project/ProjectSrc
/Developer/usr/bin/g++-4.0 -o /Developer/Project/ProjectSrc/.obj/Project.build/Release/Project.build/Objects-normal/i386/Project -L/Developer/Project/ProjectSrc/build/Release -L/usr/local/lib -L/usr/local/Trolltech/Qt-4.6.3/lib -L/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats -L/Developer/FMOD\ Programmers\ API/api/lib -L/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats -L/usr/local/Trolltech/Qt-4.6.3/lib -L/System/Library/Frameworks -F/Developer/Project/ProjectSrc/build/Release -filelist /Developer/Project/ProjectSrc/.obj/Project.build/Release/Project.build/Objects-normal/i386/Project.LinkFileList -lTagLib -lfmodex2 -lmp3lame.0 -lqjpeg -lqgif -lqmng -lqsvg -lqtiff -lqico -lQtXml -lQtGui -framework Carbon -framework AppKit -lQtCore -framework ApplicationServices -arch i386 -Wl,-Y,1455 -mmacosx-version-min=10.4 -headerpad_max_install_names -all_load -L/usr/local/lib -L/usr/local/Trolltech/Qt-4.6.3/lib -L/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats -L/Developer/FMOD\ Programmers\ API/api/lib -L/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats -L/usr/local/Trolltech/Qt-4.6.3/lib -lz -lm
/Developer/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
QSvgRenderer::load(QByteArray const&)
QSvgRenderer::render(QPainter*)
QSvgRenderer::QSvgRenderer(QObject*)
QSvgRenderer::isValid() const
QSvgRenderer::viewBox() const
/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats/libqsvg.a(qsvgiohandler.o) reference to undefined QSvgRenderer::load(QByteArray const&)
/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats/libqsvg.a(qsvgiohandler.o) reference to undefined QSvgRenderer::render(QPainter*)
/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats/libqsvg.a(qsvgiohandler.o) reference to undefined QSvgRenderer::QSvgRenderer(QObject*)
/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats/libqsvg.a(qsvgiohandler.o) reference to undefined QSvgRenderer::isValid() const
/usr/local/Trolltech/Qt-4.6.3/plugins/imageformats/libqsvg.a(qsvgiohandler.o) reference to undefined QSvgRenderer::viewBox() const
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status@Any thoughts on this? Again I appreciate your assistance!
-
Well, it seems you need to set your environment correctly to work with XCode. As I've never used XCode, the only things I can help you are the Mac stuff that the look like Linux stuff. So, try to adjust somewhere the variables LIBRARY_PATH (for the linker) and LD_LIBRARY_PATH (probably needed to run stuff correctly). If I am not wrong (again), you need add /usr/local/Trolltech/Qt-4.6.3/lib/ to both variables (set them in an analog way of what you did for PATH).
And let's see if someone who knows XCode and these OS X things can help too :-)
-
In my .pro file I have:
@QTPLUGIN += qjpeg qgif qmng qsvg qtiff qico@
Which should cover that, right?
-
Not really. The SVG support changed, as far as I remember. There is a Qt SVG module, that you can enable with adding "svg" to the QT variable (not QTPLUGIN). That adds the QtSvg.framework to the libs linked to your program and should solve the linking problem.
-
Thank you, this solved my errors.