PDA

View Full Version : [Mac] Compile Qt



Tibo6
1st December 2009, 23:25
Hello,

I am trying to compile Qt 4.6 for Mac OS X Snow Leopard but I have some difficulties.
When I run ./configure I have some errors and I don't know how to fix them.

Here are the errors :


/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:42:20: error: stdlib.h: No such file or directory
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:43:19: error: stdio.h: No such file or directory
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:44:43: error: CoreFoundation/CoreFoundation.h: No such file or directory
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:45:27: error: Carbon/Carbon.h: No such file or directory
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp: In function ‘int main(int, const char**)’:
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:53: error: ‘CFURLRef’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:53: error: expected `;' before ‘cfurl’
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:54: error: ‘OSStatus’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:54: error: expected `;' before ‘err’
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:55: error: ‘err’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:55: error: ‘noErr’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:58: error: ‘CFBundleRef’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:58: error: expected `;' before ‘bundle’
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:59: error: ‘bundle’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:62: error: ‘CFStringRef’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:62: error: expected `;' before ‘str’
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:63: error: ‘str’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:63: error: ‘CFStringGetCStringPtr’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:77: error: ‘strlen’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/dwarf2.test: line 22: ./xcodeversion: No such file or directory
rm: xcodeversion: No such file or directory

Thanks.
Bye.

schnitzel
2nd December 2009, 00:47
I could be wrong, but don't you need to install xcode if you want to build from source?

Tibo6
2nd December 2009, 11:07
I have already installed xCode from the CD. My version is 3.2.1 :)

schnitzel
2nd December 2009, 16:32
perhaps stating the obvious, but have you followed these instructions?

http://doc.qt.nokia.com/4.6/install-mac.html

Tibo6
2nd December 2009, 18:38
Yes, of course.
In fact, I have a problem during the 3rd step. The first step doesn't concern me, and the second one is hard not to succeed :p

schnitzel
2nd December 2009, 19:35
I assume you are installing in the default place, so you didn't use the -prefix option - right?

what is your path set to when you run configure?

try some of the suggestions on this page:
http://psi-im.org/wiki/Build_Instructions_Qt4#Building_on_Unix_.26_Mac_OS _X

Tibo6
2nd December 2009, 20:14
Indeed, I didn't use the -prefix option.

By default, it install Qt here : /usr/local/Trolltech/Qt-4.6.0

Thanks for your page, but still nothing good :(

Thanks for helping me :)

EDIT :
When I run ./configure, I am in the folder created after decompressing the downloaded file.

schnitzel
2nd December 2009, 20:49
so what does your path look like when you run configure.

being in the extracted folder should be the right place btw.

Tibo6
2nd December 2009, 21:34
My PATH : /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Developer/usr/bin

I tried to compile xcodeversion.cpp my self with xcode. It works, but I have the same errors anyway.

schnitzel
2nd December 2009, 22:36
one last suggestion, run configure with the verbose flag. Hopefully that will give some more clues.

I will have access to a Mac tomorrow, but that one isn't mine and has the vanilla binary install, which I don't really want to mess with.

Tibo6
2nd December 2009, 22:55
./configure -v :


Determining system architecture... (Darwin:10.2.0:i386)
'macosx' is supported
System architecture: 'macosx'
Precompiled-headers support enabled.
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:42:20: error: stdlib.h: No such file or directory
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:43:19: error: stdio.h: No such file or directory
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:44:43: error: CoreFoundation/CoreFoundation.h: No such file or directory
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:45:27: error: Carbon/Carbon.h: No such file or directory
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp: In function ‘int main(int, const char**)’:
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:53: error: ‘CFURLRef’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:53: error: expected `;' before ‘cfurl’
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:54: error: ‘OSStatus’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:54: error: expected `;' before ‘err’
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:55: error: ‘err’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:55: error: ‘noErr’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:58: error: ‘CFBundleRef’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:58: error: expected `;' before ‘bundle’
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:59: error: ‘bundle’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:62: error: ‘CFStringRef’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:62: error: expected `;' before ‘str’
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:63: error: ‘str’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:63: error: ‘CFStringGetCStringPtr’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/xcodeversion.cpp:77: error: ‘strlen’ was not declared in this scope
/qt-everywhere-opensource-src-4.6.0/config.tests/mac/dwarf2.test: line 22: ./xcodeversion: No such file or directory
rm: xcodeversion: No such file or directory
DWARF2 debug symbols enabled.
Xarch support detected
Separate debug info check skipped, QMAKE_OBJCOPY is unset.
Separate debug info support disabled.
Symbol visibility control enabled.


I read on the Internet that the directory /usr/include have to contain .h files.
But I don't have the directory include in usr.
So, I took .h files (standard library) and copied them in /usr/include
Some errors disappear, but others stay like Carbon.h and CoreFoundation. Maybe I had not copied them in the right directory ?
How can I update dev tools ?

schnitzel
2nd December 2009, 23:55
looks like your dev environment isn't complete. Try compiling a simple program (non-qt) on command line to see if that works and to make sure that xcode has been installed correctly.

try installing xcode from the mac website.

Tibo6
3rd December 2009, 20:52
I install xCode from the Mac website. But it had not resolve my problem... because the problem was me :D
In fact, when I installed xCode the first time, I unchecked an option which seemed useless to me... apparently no.
So, now it works.

Many thanks for you help ! :)