[SOLVED] Missing headers and va_start unreferenced variable error on Mavericks and Qt 5.1.1
-
Hi all, after several months of smooth and happy coding and compiling on my Qt4.7 installation on mac osx 10.8 I upgraded to Mavericks (osx 10.9) and I finally decided to upgrade to Qt 5.1.1. I correctly installed Xcode 5 and related Command Line Tools. Unfortunately my coded application immediately stopped compiling on the new platform with a first error on missing header stddef.h. I then tried to create a new wizard application from scratch and I still got the same error. By adding INCLUDEPATH += /usr/include (and paths to other missing headers I found on my mac sparsely) to my .pro file eventually brought me to the following errors:
/usr/include/c++/4.2.1/bits/c++locale.h:76: error: use of undeclared identifier 'va_start'
va_start(__args, __fmt);
^
/usr/include/c++/4.2.1/bits/c++locale.h:84: error: use of undeclared identifier 'va_end'
va_end(__args);
^
that I wasn't able to fix even after googling a lot.My questions are:
- Why does Qt5.1.1 is missing header paths that in previous versions were found automatically after installation?
- How can I fix the latter error?
I got stuck with my programming schedule and I would be very grateful if anyone could help me asap! Thanks you so much anticipately! :-)
Mario
UPDATE: I just installed Qt5.2 rc1 but I am getting exactly the same errors described above.
-
Hi and welcome to devnet,
Mavericks is known for bringing a lot of trouble, can you build Qt from sources ? If so go for 5.2 and you should be good to go
-
Hi SGaist, thank you for your suggestion. I tried building Qt5 by following the instructions at http://qt-project.org/wiki/Building_Qt_5_from_Git, but as I do:
./configure -developer-build -opensource -nomake examples -nomake tests
I get the same initial error about missing stddef.h.
Any idea? Thank you again! -
I just made a fresh build of the latest qt5 stable (all submodule on stable also) and no problem.
What version of Xcode are you using ?
-
I am using Xcode 5, and I also installed related Command line tools.
I am trying to build Qt5.2 by running ./configure. I accept LGPL license conditions. Qmake starts being created and then I get:
@.../qt-everywhere-opensource-src-5.2.0/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:46:10: fatal error:
'stddef.h' file not found
#include <stddef.h>
^
1 error generated.
make: *** [project.o] Error 1@It looks like I am missing some entry in PATHS, but how come this happens? And how can I fix this? (sorry for my basic questions)
-
Just to be sure, which sources did you download ? The zip or the tar.gz ?
-
I know you said that you "correctly installed Xcode 5 and related Command Line", but Qt5.2 compiled out-of-the-box for me on 10.9+Xcode5.0.2. (5.1.1 was a lot of trouble to build)
Can you make sure?@printf "#include <stddef.h>\nint main(){}" > tmp.cpp ; c++ tmp.cpp@
does that work?
-
Strange, like I said, I've struggle for 5.1.1, but 5.2 compiled with no problems, I used:
"./configure -debug-and-release -nomake examples ; make"You posted the error, can you post the cmd-line that caused it? That is the one that invoke the compiler. Should be in the terminal after you run make.
-
This is what I run and all the resulting output i get:
@ucmarmbp:qt-everywhere-opensource-src-5.2.0 ucmar$ ./configure -debug-and-release -nomake examples ; make
- cd qtbase
- /Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/configure -top-level -debug-and-release -nomake examples
Which edition of Qt do you want to use ?
Type 'c' if you want to use the Commercial Edition.
Type 'o' if you want to use the Open Source Edition.o
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.Type 'L' to view the Lesser GNU General Public License version 2.1.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.Do you accept the terms of the license? yes
Creating qmake...
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -o project.o -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.6 -g -gdwarf-2 -fconstant-cfstrings -g -DQMAKE_OPENSOURCE_EDITION -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/library -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/generators -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/generators/unix -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/generators/win32 -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/generators/mac -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/generators/integrity -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/include -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtCore -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtCore/5.2.0 -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtCore/5.2.0/QtCore -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/src/corelib/global -DHAVE_QCONFIG_CPP -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/mkspecs/macx-clang -I/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/tools/shared -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY /Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/project.cpp
In file included from /Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/project.cpp:42:
In file included from /Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/project.h:45:
In file included from /Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/library/qmakeevaluator.h:49:
In file included from /Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/library/qmakeparser.h:45:
In file included from /Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/qmake/library/qmake_global.h:45:
In file included from /Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtCore/qglobal.h:1:
/Users/ucmar/Repositories/qt5/qt-everywhere-opensource-src-5.2.0/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:46:10: fatal error:
'stddef.h' file not found
#include <stddef.h>
^
1 error generated.
make: *** [project.o] Error 1
make: *** No targets specified and no makefile found. Stop.@ -
Exact match with mine. Something wrong on your system my friend...