I have been trying to install QuantLib and want to use it in Python. However, I am having great trouble building Quantlib-SWIG and hopefully I can get some help here.
I was able to build Quantlib and run all test suite successfully following procedure of http://quantlib.org/install/macosx.shtml (I am on Lion, if it matters). After I download and unzip the Quantlib-SWIG and try to do python setup.py build, I got a lot of errors, all seem to be somewhat repeating of following:
QuantLib/quantlib_wrap.cpp:5640: instantiated from ‘static int swig::traits_asptr<std::vector<T, std::allocator<_CharT> > >::asptr(PyObject*, std::vector<T, std::allocator<_CharT> >**) [with T = boost::shared_ptr<QuantLib::Quote>]’
QuantLib/quantlib_wrap.cpp:4663: instantiated from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >]’
QuantLib/quantlib_wrap.cpp:43476: instantiated from here
/opt/local/include/boost/assign/assignment_exception.hpp:24: error: ‘boost::assign’ is not a function,
QuantLib/quantlib_wrap.cpp:5558: error: conflict with ‘template<class SwigPySeq, class Seq> void swig::assign(const SwigPySeq&, Seq*)’
QuantLib/quantlib_wrap.cpp:5585: error: in call to ‘assign’
/opt/local/include/boost/assign/assignment_exception.hpp: In static member function ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, Seq**) [with Seq = std::vector<std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >, std::allocator<std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > > > >, T = std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >]’:
QuantLib/quantlib_wrap.cpp:5640: instantiated from ‘static int swig::traits_asptr<std::vector<T, std::allocator<_CharT> > >::asptr(PyObject*, std::vector<T, std::allocator<_CharT> >**) [with T = std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >]’
QuantLib/quantlib_wrap.cpp:4663: instantiated from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >, std::allocator<std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > > > >]’
QuantLib/quantlib_wrap.cpp:45813: instantiated from here
/opt/local/include/boost/assign/assignment_exception.hpp:24: error: ‘boost::assign’ is not a function,
QuantLib/quantlib_wrap.cpp:5558: error: conflict with ‘template<class SwigPySeq, class Seq> void swig::assign(const SwigPySeq&, Seq*)’
QuantLib/quantlib_wrap.cpp:5585: error: in call to ‘assign’
/opt/local/include/boost/assign/assignment_exception.hpp: In static member function ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, Seq**) [with Seq = std::vector<boost::shared_ptr<QuantLib::StochasticProcess>, std::allocator<boost::shared_ptr<QuantLib::StochasticProcess> > >, T = boost::shared_ptr<QuantLib::StochasticProcess>]’:
QuantLib/quantlib_wrap.cpp:5640: instantiated from ‘static int swig::traits_asptr<std::vector<T, std::allocator<_CharT> > >::asptr(PyObject*, std::vector<T, std::allocator<_CharT> >**) [with T = boost::shared_ptr<QuantLib::StochasticProcess>]’
QuantLib/quantlib_wrap.cpp:4663: instantiated from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<boost::shared_ptr<QuantLib::StochasticProcess>, std::allocator<boost::shared_ptr<QuantLib::StochasticProcess> > >]’
QuantLib/quantlib_wrap.cpp:124772: instantiated from here
/opt/local/include/boost/assign/assignment_exception.hpp:24: error: ‘boost::assign’ is not a function,
QuantLib/quantlib_wrap.cpp:5558: error: conflict with ‘template<class SwigPySeq, class Seq> void swig::assign(const SwigPySeq&, Seq*)’
QuantLib/quantlib_wrap.cpp:5585: error: in call to ‘assign’
I tried a couple version of SWIG and Quantlib-SWIG and didn't seem to have any luck. I have tried SWIG 3.0.6 and 3.0.2. Quantlib-SWIG 1.5 and 1.6. My Quantlib version is 1.6 and boost should be latest as I installed from macports.
Is there anything I am missing?
It appeared to be an issue with namespace not being specified. After adding the namespace, it compiled correctly.
Related
I have a problem with cereal library (http://uscilab.github.io/cereal/).
I have a shared library, and I would like to serialize one of its classes using cereal library. It has a member of time_point from std::chrono
Here is a part of the code of my object in Event.h
#include <cereal/types/chrono.hpp>
#include <cereal/types/string.hpp>
class Event
{
private:
std::string m_Id;
std::chrono::high_resolution_clock::time_point m_StartTime;
public:
template<class Archive> void serialize(Archive & archive)
{
archive(m_Id, m_StartTime);
}
The library compiles without a problem. Then I would like to use my library in an executable where I try to serialize one of the object:
#include "Event.h"
#include <cereal/archives/json.hpp>
cereal::JSONOutputArchive output(std::cout);
output(API::Event());
This code does not compile and it is complaining about the missing serialize function for the time_point. If I intend to serialize only the string it compiles.
Build error output:
[ 20%] Building CXX object CMakeFiles/plugin.dir/src/main.cpp.o
In file included from /cereal/include/cereal/types/memory.hpp:33:0,
from main.cpp:7:
cereal/include/cereal/cereal.hpp: In instantiation of ‘ArchiveType&
cereal::OutputArchive<ArchiveType, Flags>::processImpl(const T&) [with T = std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >; typename cereal::traits::detail::EnableIfHelper<(cereal::traits::has_invalid_output_versioning<T, ArchiveType>::value || ((! cereal::traits::is_output_serializable<T, ArchiveType>::value) && ((!(Flags & AllowEmptyClassElision)) || ((Flags & AllowEmptyClassElision) && (! std::is_empty<T>::value)))))>::type <anonymous> = (cereal::traits::detail::type)0; ArchiveType = cereal::JSONOutputArchive; unsigned int Flags = 0]’:
cereal/include/cereal/cereal.hpp:347:9: required from ‘void cereal::OutputArchive<ArchiveType, Flags>::process(T&&) [with T = std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&; ArchiveType = cereal::JSONOutputArchive; unsigned int Flags = 0]’
cereal/include/cereal/cereal.hpp:249:9: required from ‘ArchiveType& cereal::OutputArchive<ArchiveType, Flags>::operator()(Types&& ...) [with Types = {std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&}; ArchiveType = cereal::JSONOutputArchive; unsigned int Flags = 0]’
Event.h:66:16: required from ‘void Event::serialize(Archive&) [with Archive = cereal::JSONOutputArchive]’
cereal/include/cereal/access.hpp:243:51: required from ‘static decltype (t.serialize(ar)) cereal::access::member_serialize(Archive&, T&) [with Archive = cereal::JSONOutputArchive; T = Event; decltype (t.serialize(ar)) = void]’
cereal/include/cereal/cereal.hpp:400:33: required from ‘ArchiveType& cereal::OutputArchive<ArchiveType, Flags>::processImpl(const T&) [with T = Event; typename cereal::traits::detail::EnableIfHelper<cereal::traits::has_member_serialize<T, ArchiveType>::value, (! cereal::traits::has_invalid_output_versioning<T, ArchiveType>::value), (cereal::traits::is_output_serializable<T, ArchiveType>::value && (cereal::traits::is_specialized_member_serialize<T, ArchiveType>::value || (! cereal::traits::is_specialized<T, ArchiveType>::value)))>::type <anonymous> = (cereal::traits::detail::type)0; ArchiveType = cereal::JSONOutputArchive; unsigned int Flags = 0]’
cereal/include/cereal/cereal.hpp:347:9: required from ‘void cereal::OutputArchive<ArchiveType, Flags>::process(T&&) [with T = Event; ArchiveType = cereal::JSONOutputArchive; unsigned int Flags = 0]’
cereal/include/cereal/cereal.hpp:249:9: required from ‘ArchiveType& cereal::OutputArchive<ArchiveType, Flags>::operator()(Types&& ...) [with Types = {Event}; ArchiveType = cereal::JSONOutputArchive; unsigned int Flags = 0]’
main.cpp:38:36: required from here
cereal/include/cereal/cereal.hpp:462:9: error: static assertion failed: cereal could not find any output serialization functions for the provided type and archive combination.
EDIT:
I guess the problem is coming from the fact that the serialization function is defined in the shared library.
If I just compile a test class (not in my project just for test) having an time_point it works as expected.
It looks like it was due to the order of the include. The include of the archives must be before the include of the types/chrono. So the right order is:
#include <cereal/archives/json.hpp>
#include "Event.h"
cereal::JSONOutputArchive output(std::cout);
output(API::Event());
Given this c++11 code: (everything remains the same compiling as c++14 or c++17)
class typeSafe {
public:
typeSafe(int tValue)
: value(tValue) {
}
explicit operator int() const {
return value;
}
private:
int value;
};
int main() {
typeSafe x{5};
typeSafe y{5};
if(static_cast<const int&>(x) == static_cast<const int&>(y)) {
}
}
The controversy is because the static_cast attempts converting to a const int&, but the explicit operator gives an int, not an int&.
clang 5.0.0 silently compiles it, with every warning turned on.
gcc rejects it, with:
typeSafe.cpp: In function ‘int main()’:
typeSafe.cpp:17:32: error: invalid static_cast from type ‘typeSafe’ to type ‘const int&’
if(static_cast<const int&>(x) == static_cast<const int&>(y)) {
^
typeSafe.cpp:17:62: error: invalid static_cast from type ‘typeSafe’ to type ‘const int&’
if(static_cast<const int&>(x) == static_cast<const int&>(y)) {
^
Visual Studio 2017 15.5 Preview 2 rejects it, with:
typeSafe.cpp(17): error C2440: 'static_cast': cannot convert from 'typeSafe' to 'const int &'
typeSafe.cpp(17): note: Reason: cannot convert from 'typeSafe' to 'const int'
typeSafe.cpp(17): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Note if the static_cast attempts converting to an int&, then all 3 compilers reject it, with clang saying:
typeSafe.cpp:17:7: error: non-const lvalue reference to type 'int' cannot
bind to a value of unrelated type 'typeSafe'
if(static_cast<int&>(x) == static_cast<int&>(y)) {
^ ~
typeSafe.cpp:17:31: error: non-const lvalue reference to type 'int' cannot
bind to a value of unrelated type 'typeSafe'
if(static_cast<int&>(x) == static_cast<int&>(y)) {
^ ~
So, who's right and who's wrong?
I'm running into a problem with ambiguity with an Assignment partial specialization inside the inverse method of the full-pivot Householder decomposition of a dense matrix in the first release candidate for 3.3, 3.3.rc1. Here's a minimal example that produces the error we're getting compiling the Stan math library:
#include <Eigen/Dense>
int main() {
using Eigen::MatrixXd;
MatrixXd m(2, 2);
m << 1, 0, 0, 1;
Eigen::FullPivHouseholderQR<MatrixXd> hh
= m.fullPivHouseholderQr();
MatrixXd m_inv_transpose = hh.inverse();
}
Are we not using FullPivHouseholderQR the right way?
Here's the error I get using clang++ on Mac OS X (Apple LLVM version 7.0.2 (clang-700.1.81)):
temp2$ clang++ -isystem ~/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1 fph.cpp
In file included from fph.cpp:1:
In file included from /Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/Dense:1:
In file included from /Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/Core:389:
/Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/src/Core/AssignEvaluator.h:813:3: error: ambiguous partial specializations
of 'Assignment, Eigen::Inverse > >, Eigen::internal::assign_op, Eigen::internal::Dense2Dense, void>'
Assignment::run(actualDst, src, func);
^
/Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/src/Core/PlainObjectBase.h:721:17: note: in instantiation of function
template specialization 'Eigen::internal::call_assignment_no_alias,
Eigen::Inverse > >, Eigen::internal::assign_op
>' requested here
internal::call_assignment_no_alias(this->derived(), other.derived(), internal::assign_op());
^
/Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/src/Core/PlainObjectBase.h:531:7: note: in instantiation of function
template specialization 'Eigen::PlainObjectBase
>::_set_noalias > > >' requested here
_set_noalias(other);
^
/Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/src/Core/Matrix.h:379:9: note: in instantiation of function template
specialization 'Eigen::PlainObjectBase
>::PlainObjectBase > > >' requested here
: Base(other.derived())
^
fph.cpp:9:30: note: in instantiation of function template specialization 'Eigen::Matrix::Matrix > > >' requested here
MatrixXd m_inv_transpose = hh.inverse();
^
/Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/src/Core/AssignEvaluator.h:851:8: note: partial specialization matches
[with DstXprType = Eigen::Matrix, SrcXprType =
Eigen::Inverse > >, Functor =
Eigen::internal::assign_op, Weak = void]
struct Assignment
^
/Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/src/LU/InverseImpl.h:290:8: note: partial specialization matches [with
DstXprType = Eigen::Matrix, XprType = Eigen::FullPivHouseholderQR >]
struct Assignment, internal::assign_op, Dense2Dense>
^
/Users/carp/cmdstan/stan/lib/stan_math/lib/eigen_3.3.rc1/Eigen/src/QR/FullPivHouseholderQR.h:579:8: note: partial specialization matches
[with DstXprType = Eigen::Matrix, MatrixType = Eigen::Matrix, Scalar = double]
struct Assignment >, internal::assign_op, Dense2Dense>
^
1 error generated.
I am facing an issue while compiling the Cilk++ code with Boost Library.
The Boost Library has been installed outside /usr/include.
I used a -I option to specify the boost directory while compiling with cilk++. I am getting the following error.
/home/user/boost_1_51_0/boost/multi_array.hpp: In member function
‘boost::multi_array<T, NumDims, Allocator>& cilk boost::multi_array<T,
NumDims, Allocator>::resize(const
boost::detail::multi_array::extent_gen<NumDims>&) [with T = float,
long unsigned int NumDims = 2ul, Allocator = std::allocator<float>]’:
kdtree2.h:95: instantiated from here
/home/user/boost_1_51_0/boost/multi_array.hpp:415: error: no matches
converting function ‘min’ to type ‘const
boost::multi_array_types::size_type& (cilk*)(const
boost::multi_array_types::size_type&, const
boost::multi_array_types::size_type&)’
/home/user/cilk/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/../../../../include/c++/4.2.4/bits/stl_algobase.h:182:
error: candidates are: template<class _Tp> const _Tp& std::min(const
_Tp&, const _Tp&) /home/user/cilk/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/../../../../include/c++/4.2.4/bits/stl_algobase.h:226:
error: template<class _Tp, class _Compare> const _Tp& std::min(const
_Tp&, const _Tp&, _Compare)
The issue got resolved by using the -isystem option during compilation.
I installed Qt and tried to build a template project (Qt4 Gui Application) in QtCreator. I can't figure out why I am getting these errors.
Running build steps for project SourceControl...
Configuration unchanged, skipping QMake step.
Starting: /usr/bin/make -w
make: Entering directory `/Users/jason/SourceControl'
g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.5/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/usr/include/QtNetwork -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I. -I. -F/Library/Frameworks -o main.o main.cpp
In file included from /Library/Frameworks/QtCore.framework/Headers/qnamespace.h:45,
from /Library/Frameworks/QtCore.framework/Headers/qobjectdefs.h:45,
from /Library/Frameworks/QtCore.framework/Headers/qobject.h:47,
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1,
from main.cpp:1:
/Library/Frameworks/QtCore.framework/Headers/qglobal.h:297:34: error: AvailabilityMacros.h: No such file or directory
In file included from /Library/Frameworks/QtCore.framework/Headers/qstring.h:46,
from /Library/Frameworks/QtCore.framework/Headers/qobject.h:48,
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1,
from main.cpp:1:
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h:48:20: error: string.h: No such file or directory
In file included from /Library/Frameworks/QtCore.framework/Headers/qobject.h:48,
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1,
from main.cpp:1:
/Library/Frameworks/QtCore.framework/Headers/qstring.h:60:22: error: string: No such file or directory
In file included from /Library/Frameworks/QtCore.framework/Headers/qobject.h:50,
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1,
from main.cpp:1:
/Library/Frameworks/QtCore.framework/Headers/qlist.h:50:20: error: iterator: No such file or directory
/Library/Frameworks/QtCore.framework/Headers/qlist.h:51:16: error: list: No such file or directory
/Library/Frameworks/QtCore.framework/Headers/qlist.h:54:15: error: new: No such file or directory
In file included from /Library/Frameworks/QtGui.framework/Headers/qbrush.h:47,
from /Library/Frameworks/QtGui.framework/Headers/qpalette.h:47,
from /Library/Frameworks/QtGui.framework/Headers/qwidget.h:48,
from /Library/Frameworks/QtGui.framework/Headers/qmainwindow.h:45,
from /Library/Frameworks/QtGui.framework/Headers/QMainWindow:1,
from mainwindow.h:4,
from main.cpp:2:
/Library/Frameworks/QtCore.framework/Headers/qvector.h:52:18: error: vector: No such file or directory
/Library/Frameworks/QtCore.framework/Headers/qvector.h:54:20: error: stdlib.h: No such file or directory
In file included from /Library/Frameworks/QtCore.framework/Headers/qstring.h:46,
from /Library/Frameworks/QtCore.framework/Headers/qobject.h:48,
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1,
from main.cpp:1:
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h: In function 'uint qstrlen(const char*)':
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h:68: error: 'strlen' was not declared in this scope
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h: In function 'int qstrncmp(const char*, const char*, uint)':
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h:91: error: 'strncmp' was not declared in this scope
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h: In function 'bool operator==(const QByteArray&, const QByteArray&)':
/Library/Frameworks/QtCore.framework/Headers/qbytearray.h:502: error: 'memcmp' was not declared in this scope
In file included from /Library/Frameworks/QtCore.framework/Headers/qobject.h:48,
from /Library/Frameworks/QtCore.framework/Headers/qcoreapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/qapplication.h:45,
from /Library/Frameworks/QtGui.framework/Headers/QApplication:1,
from main.cpp:1:
/Library/Frameworks/QtCore.framework/Headers/qstring.h: At global scope:
/Library/Frameworks/QtCore.framework/Headers/qstring.h:65: error: expected initializer before ' QList::fromStdList()':
/Library/Frameworks/QtCore.framework/Headers/qlist.h:316: error: 'list' was not declared in this scope
/Library/Frameworks/QtCore.framework/Headers/qlist.h:316: error: 'back_inserter' is not a member of 'std'
In file included from /Library/Frameworks/QtGui.framework/Headers/qbrush.h:47,
from /Library/Frameworks/QtGui.framework/Headers/qpalette.h:47,
from /Library/Frameworks/QtGui.framework/Headers/qwidget.h:48,
from /Library/Frameworks/QtGui.framework/Headers/qmainwindow.h:45,
from /Library/Frameworks/QtGui.framework/Headers/QMainWindow:1,
from mainwindow.h:4,
from main.cpp:2:
/Library/Frameworks/QtCore.framework/Headers/qvector.h: At global scope:
/Library/Frameworks/QtCore.framework/Headers/qvector.h:293: error: expected unqualified-id before ' QVector::fromStdVector()':
/Library/Frameworks/QtCore.framework/Headers/qvector.h:294: error: 'vector' was not declared in this scope
/Library/Frameworks/QtCore.framework/Headers/qvector.h:294: error: 'back_inserter' is not a member of 'std'
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In constructor 'QVector::QVector(int) [with T = QPoint]':
/Library/Frameworks/QtGui.framework/Headers/qpolygon.h:93: instantiated from here
/Library/Frameworks/QtCore.framework/Headers/qvector.h:397: error: no matching function for call to 'operator new(long unsigned int, QPoint*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In constructor 'QVector::QVector(int) [with T = QPointF]':
/Library/Frameworks/QtGui.framework/Headers/qpolygon.h:152: instantiated from here
/Library/Frameworks/QtCore.framework/Headers/qvector.h:397: error: no matching function for call to 'operator new(long unsigned int, QPointF*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qlist.h: In member function 'void QList::node_construct(QList::Node*, const T&) [with T = QString]':
/Library/Frameworks/QtCore.framework/Headers/qlist.h:426: instantiated from 'void QList::append(const T&) [with T = QString]'
/Library/Frameworks/QtCore.framework/Headers/qstringlist.h:70: instantiated from here
/Library/Frameworks/QtCore.framework/Headers/qlist.h:341: error: no matching function for call to 'operator new(long unsigned int, QList::Node*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qlist.h: In member function 'void QList::node_copy(QList::Node*, QList::Node*, QList::Node*) [with T = QString]':
/Library/Frameworks/QtCore.framework/Headers/qlist.h:618: instantiated from 'QList& QList::operator+=(const QList&) [with T = QString]'
/Library/Frameworks/QtCore.framework/Headers/qstringlist.h:85: instantiated from here
/Library/Frameworks/QtCore.framework/Headers/qlist.h:360: error: no matching function for call to 'operator new(long unsigned int, QList::Node*)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In member function 'void QVector::realloc(int, int) [with T = QPoint]':
/Library/Frameworks/QtCore.framework/Headers/qvector.h:315: instantiated from 'void QVector::detach_helper() [with T = QPoint]'
/Library/Frameworks/QtCore.framework/Headers/qvector.h:113: instantiated from 'QVector::QVector(const QVector&) [with T = QPoint]'
/Library/Frameworks/QtGui.framework/Headers/qpolygon.h:66: instantiated from here
/Library/Frameworks/QtCore.framework/Headers/qvector.h:444: error: no matching function for call to 'operator new(long unsigned int, QPoint*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h:484: error: no matching function for call to 'operator new(long unsigned int, QPoint*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h:491: error: no matching function for call to 'operator new(long unsigned int, QPoint*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In member function 'void QVector::realloc(int, int) [with T = QPointF]':
/Library/Frameworks/QtCore.framework/Headers/qvector.h:315: instantiated from 'void QVector::detach_helper() [with T = QPointF]'
/Library/Frameworks/QtCore.framework/Headers/qvector.h:113: instantiated from 'QVector::QVector(const QVector&) [with T = QPointF]'
/Library/Frameworks/QtGui.framework/Headers/qpolygon.h:131: instantiated from here
/Library/Frameworks/QtCore.framework/Headers/qvector.h:444: error: no matching function for call to 'operator new(long unsigned int, QPointF*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h:484: error: no matching function for call to 'operator new(long unsigned int, QPointF*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h:491: error: no matching function for call to 'operator new(long unsigned int, QPointF*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h: In member function 'void QVector::realloc(int, int) [with T = QPainterPath::Element]':
/Library/Frameworks/QtCore.framework/Headers/qvector.h:315: instantiated from 'void QVector::detach_helper() [with T = QPainterPath::Element]'
/Library/Frameworks/QtCore.framework/Headers/qvector.h:129: instantiated from 'void QVector::detach() [with T = QPainterPath::Element]'
/Library/Frameworks/QtCore.framework/Headers/qvector.h:228: instantiated from 'T* QVector::begin() [with T = QPainterPath::Element]'
/Library/Frameworks/QtCore.framework/Headers/qvector.h:241: instantiated from 'T& QVector::first() [with T = QPainterPath::Element]'
/Library/Frameworks/QtGui.framework/Headers/qpainterpath.h:370: instantiated from here
/Library/Frameworks/QtCore.framework/Headers/qvector.h:444: error: no matching function for call to 'operator new(long unsigned int, QPainterPath::Element*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h:315: instantiated from 'void QVector::detach_helper() [with T = QPainterPath::Element]'
/Library/Frameworks/QtCore.framework/Headers/qvector.h:129: instantiated from 'void QVector::detach() [with T = QPainterPath::Element]'
/Library/Frameworks/QtCore.framework/Headers/qvector.h:228: instantiated from 'T* QVector::begin() [with T = QPainterPath::Element]'
/Library/Frameworks/QtCore.framework/Headers/qvector.h:241: instantiated from 'T& QVector::first() [with T = QPainterPath::Element]'
/Library/Frameworks/QtGui.framework/Headers/qpainterpath.h:370: instantiated from here
/Library/Frameworks/QtCore.framework/Headers/qvector.h:484: error: no matching function for call to 'operator new(long unsigned int, QPainterPath::Element*&)'
:0: note: candidates are: void* operator new(long unsigned int)
/Library/Frameworks/QtCore.framework/Headers/qvector.h:491: error: no matching function for call to 'operator new(long unsigned int, QPainterPath::Element*&)'
:0: note: candidates are: void* operator new(long unsigned int)
make: *** [main.o] Error 1
make: Leaving directory `/Users/jason/SourceControl'
Exited with code 2.
Error while building project SourceControl
When executing build step 'Make'
I'm not sure but I guess you should focus on the first error where it says it can't find AvailabilityMacros.h. I think that should be in /usr/include but I'm guessing it probably isn't since your compile line clearly shows that as one of the include paths.
If it's not there you could try to find out where it is by using find on the command line eg.
find /usr -name AvailabilityMacros.h
or whatever GUI methods are available on the Mac ( you can tell I'm not that familiar with MacOS :) ). BTW if the above find command yields nothing then you can widen the search from /usr to /.
In response to your posting of the find results:
Are you trying to build your application against the MacOSX10.5.sdk? If not then I don't think that's the version you want. If you are using the 10.5 SDK then you need to set the QMAKE_MAC_SDK qmake variable to /Developer/SDKs/MacOSX10.5.sdk. You can either do this in the project file or set it as an additional argument to qmake in Projects->Build steps.
Thanks, Troubadour. I was able to solve the problem by adding the following line to my project's .pro file:
QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.5.sdk
I would prefer to build against the Mac OS X 10.6 SDK but there is no such directory in /Developer/SDKs. If you know where I can find the 10.6 SDK please let me know.
EDIT: After updating to the latest version of Xcode, I was able to remove the line indicated above from my project's .pro file and compile successfully.