Alexander, thanks very much!  I did find the problem and a workaround,
and a guess as to what had gone wrong.  It is an Xcode-related problem,
but since this might bite others I'll describe it here.

One suggestion for fink developers:
*Under 10.7, don't prepend /Developer/usr/bin to the build $PATH.*
   It shouldn't exist, and if it does, you shouldn't use it.

Details:

There turned out to be at least two sets of command-line tools
on my MacOS 10.7.4, Xcode 4.3.2 system:
one in /usr/bin (and /usr/llvm-gcc-4.2/bin...), and
another in /Developer/usr/bin (and /Developer/usr/llvm-gcc-4.2/bin...).

Though the /usr/bin versions are in my $PATH, the fink installer prepends /Developer/usr/bin to $PATH,
so fink tries to compile with /Developer/usr/bin/llvm-g++-4.2 etc.

These two are independently installed. The one in /usr/bin ~ /usr/llvm-gcc-4.2/bin gets updated when you ask Xcode to update the "command line tools". It works sensibly. The compiler's built-in include-path includes /usr/include/c++/4.2.1/include, which is fine.

The /Developer/usr/bin ~ /Developer/usr/llvm-gcc-4.2/bin copy is broken.
I'd assumed it came from the Xcode 4.3 which I'd downloaded from Apple's
itunes web site.   But /Developer/usr/bin/llvm-g++-4.2 looks in an
*obsolete* directory for C++-specific files, namely
    /usr/include/c++/4.0.0/include
even though it's a version-4.2 compiler!

Hence it couldn't find <new>, and presumably wouldn't have found lots of other things either.

Possible explanation:
I'd used Migration Assistant to carry over MacOS 10.5 system files to my 10.7 machine. I'm guessing that 10.5's Xcode had an early llvm compiler -- a new compiler, but built to use the then-current 4.0.0 C++ headers. The compiler was installed under /Developer/usr/... rather than /usr/... Migration Ass't migrated the compiler but not the include files.

Migration Assistant helpfully migrated it. fink helpfully found it. But it was broken.

   Running "pkgutil --file-info /Developer/usr/bin/llvm-gcc-4.2"
   confirms that no 10.7 package knows about this file.

Workaround:
Get rid of /Developer/usr/... I think this entire tree should not be there under 10.7. On my system, all the files under /Developer/usr had nearly the same ctime, which
   makes it look more likely that Migration Assistant put them all there.




On 6/14/12 8:06 PM, Alexander Hansen wrote:
On 6/13/12 3:21 PM, Stuart Levy wrote:
I'm having trouble building Qt4 (qt4-base-{mac,x11}-4.7.3-35) on MacOS
10.7 with current fink, and the
compiler that it chose by default, llvm-g++-4.2.

The important error seems to be this one:
/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/include/QtCore/../../src/corelib/tools/qlist.h:54:15:
error: new: No such file or directory

... with all the later errors following from that.   I don't understand
how the compiler isn't finding it -- there's no problem compiling a
trivial "#include<new>" program with llvm-g++-4.2.  And the reported
command line doesn't mention -nostdinc or anything.

However, I suspect the reported command line might not be the whole
story.  When I run that same command (below) on its own, while in the
/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/qmake
directory where project.cpp is, I get a very different error:
/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/include/QtCore/qconfig.h:1:46:
error: ../../src/corelib/global/qconfig.h: No such file or directory

What could be happening?

Thanks for any advice.

      Stuart

Here's the latter part of the build output, including all the errors,
plus fink/xcode/etc. version info at the bottom:

[...]
header created for
/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/src/qt3support/widgets/q3vbox.h
(2)
header created for
/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/src/qt3support/widgets/q3vgroupbox.h
(2)
header created for
/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/src/qt3support/widgets/q3whatsthis.h
(2)
header created for
/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/src/qt3support/widgets/q3widgetstack.h
(2)
header (master) created for Qt3Support
headers.pri file created for Qt3Support
Creating qmake. Please wait...
llvm-g++-4.2 -c -o project.o -arch i386 -pipe
-I/sw/lib/system-openssl/include -DQMAKE_OPENSOURCE_EDITION -g
-fconstant-cfstrings -I. -Igenerators -Igenerators/unix
-Igenerators/win32 -Igenerators/mac -Igenerators/symbian
-I/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/include
-I/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/include/QtCore
-I/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/src/corelib/global
-I/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/src/corelib/xml
-I/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/tools/shared
-DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL
-DQT_NO_COMPRESS
-I/sw/src/fink.build/qt4-base-mac-4.7.3-35/qt-kde-qt-mac/mkspecs/macx-g++ 
-DHAVE_QCONFIG_CPP
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT  project.cpp

Since my build output looks identical at this point, capture a log file
(in /private/tmp) via "fink -l build qt4-mac" and send it to me (the
maintainer's busy).  There may be a glaringly obvious difference earlier
on in the build.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fink-users mailing list
[email protected]
List archive:
http://news.gmane.org/gmane.os.macosx.fink.user
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to