Compiling player/stage on Mac os x - macos

Not sure if any had this problem or similar but if you have some help would be appreciated.
I have setup postgresql in the following location and set the link path to /usr/local/pgsql-9.0. Also setup the libpqxx in the /usr/local/lib
But I am guessing the error says that it cant find the postgresql anywhere. Is that correct ?
Linking CXX shared library libplayerdrivers.dylib Undefined symbols: "_PQntuples", referenced from:
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::GetLayerData(char const*)in dbconn.o "_PQresultErrorMessage", referenced from:
Postlog::rollback() constin postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o "_PQgetvalue", referenced from:
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQexecParams", referenced from:
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o "_PQresultStatus", referenced from:
Postlog::rollback() constin postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQexec", referenced from:
Postlog::rollback() constin postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQgetlength", referenced from:
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQbinaryTuples", referenced from:
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o "_PQclear", referenced from:
Postlog::rollback() constin postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQsetdbLogin", referenced from:
Postlog::Setup() in postlog.o
PostgresConn::Connect(char const*, char const*, char const*, char const*, char const*)in dbconn.o "_PQstatus", referenced from:
Postlog::Setup() in postlog.o
Postlog::isConnected() const in postlog.o
PostgresConn::Connected() in postgis.o
PostgresConn::Connect(char const*, char const*, char const*, char const*, char const*)in dbconn.o "_PQfinish", referenced from:
Postlog::Shutdown() in postlog.o
Postlog::~Postlog()in postlog.o
Postlog::~Postlog()in postlog.o
Postlog::~Postlog()in postlog.o
PostgresConn::Disconnect() in dbconn.o
ld: symbol(s) not found

Thanks to "mu is too short" its indeed the missing -lpq
Looks like there is a bug with the player/stage build for Mac Os X

Related

I am getting issues, when compiling my code in codeblocks C++

I am trying to do my assignment for data structures class. The question is 1) Compile with UNIT_TEST defined and then run with -d yes to see the time it takes in seconds. Report that time in submission box along with the time you found when testing Selection Sort. Which is faster?
i am having trouble with understanding, what i am doing wrong. I am getting this error :
g++ -o bin/Debug/algAnalysis obj/Debug/main.o
Undefined symbols for architecture x86_64:
"Catch::NameAndTags::NameAndTags(Catch::StringRef const&, Catch::StringRef const&)", referenced from:
___cxx_global_var_init in main.o
"Catch::StringMaker<int, void>::convert(int)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::stringify<int>(int const&) in main.o
"Catch::makeTestInvoker(void (*)())", referenced from:
___cxx_global_var_init in main.o
"Catch::AssertionHandler::handleExpr(Catch::ITransientExpression const&)", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
"Catch::AssertionHandler::handleUnexpectedInflightException()", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
"Catch::AssertionHandler::complete()", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
"Catch::AssertionHandler::AssertionHandler(Catch::StringRef, Catch::SourceLineInfo const&, Catch::StringRef, Catch::ResultDisposition::Flags)", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
"Catch::ITransientExpression::~ITransientExpression()", referenced from:
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::MatchExpr(std::__1::vector<int, std::__1::allocator<int> > const&, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > const&, Catch::StringRef) in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::~MatchExpr() in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::MatchExpr(std::__1::vector<int, std::__1::allocator<int> > const&, Catch::Matchers::Vector::EqualsMatcher<int> const&, Catch::StringRef) in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::~MatchExpr() in main.o
"Catch::ReusableStringStream::ReusableStringStream()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::rangeToString<std::__1::__wrap_iter<int const*> >(std::__1::__wrap_iter<int const*>, std::__1::__wrap_iter<int const*>) in main.o
"Catch::ReusableStringStream::~ReusableStringStream()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::rangeToString<std::__1::__wrap_iter<int const*> >(std::__1::__wrap_iter<int const*>, std::__1::__wrap_iter<int const*>) in main.o
"Catch::Detail::unprintableString", referenced from:
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
"Catch::AutoReg::AutoReg(Catch::ITestInvoker*, Catch::SourceLineInfo const&, Catch::StringRef const&, Catch::NameAndTags const&)", referenced from:
___cxx_global_var_init in main.o
"Catch::AutoReg::~AutoReg()", referenced from:
___cxx_global_var_init in main.o
"Catch::Matchers::Impl::MatcherUntypedBase::~MatcherUntypedBase()", referenced from:
Catch::Matchers::Impl::MatcherBase<std::__1::vector<int, std::__1::allocator<int> > >::~MatcherBase() in main.o
"Catch::StringRef::StringRef(char const*)", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
___cxx_global_var_init in main.o
(maybe you meant: __ZN5Catch9StringRefC1EPKcm)
"Catch::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, Catch::StringRef const&)", referenced from:
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
"Stack::pop(int&)", referenced from:
SortClass<int>::sort(int*, int, int) in main.o
"Stack::push(int)", referenced from:
SortClass<int>::sort(int*, int, int) in main.o
"Stack::Stack(int)", referenced from:
SortClass<int>::sort(int*, int, int) in main.o
"Stack::~Stack()", referenced from:
SortClass<int>::sort(int*, int, int) in main.o
"Catch::ReusableStringStream::str() const", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::rangeToString<std::__1::__wrap_iter<int const*> >(std::__1::__wrap_iter<int const*>, std::__1::__wrap_iter<int const*>) in main.o
"Catch::Matchers::Impl::MatcherUntypedBase::toString() const", referenced from:
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > >::describe() const in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
"typeinfo for Catch::ITransientExpression", referenced from:
typeinfo for Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > > in main.o
typeinfo for Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> > in main.o
"typeinfo for Catch::Matchers::Impl::MatcherUntypedBase", referenced from:
typeinfo for Catch::Matchers::Impl::MatcherBase<std::__1::vector<int, std::__1::allocator<int> > > in main.o
"vtable for Catch::ITransientExpression", referenced from:
Catch::ITransientExpression::ITransientExpression(bool, bool) in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for Catch::Matchers::Impl::MatcherUntypedBase", referenced from:
Catch::Matchers::Impl::MatcherUntypedBase::MatcherUntypedBase(Catch::Matchers::Impl::MatcherUntypedBase const&) in main.o
Catch::Matchers::Impl::MatcherUntypedBase::MatcherUntypedBase() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Process terminated with status 1 (0 minute(s), 0 second(s))
Here is my code so far:
#define CATCH_CONFIG_MAI
#define UNIT_TEST
#include <iostream>
#include <fstream>
#include <vector>
#ifdef UNIT_TEST
#include "catch.hpp"
#endif // UNIT_TEST
#include "stack.h"
using namespace std;
template <class T>
class SortClass
{
private:
void swap(T &a, T&b);
int split(T a[], int first, int last);
public:
void sort(T a[], int first, int last);
};
template <typename T>
int SortClass <T>::split (T arr[], int first, int last)
{
T x= arr[last];
int i= (first-1);
for (int j=first; j <= last-1; j++)
{
if (arr[j]<= x)
{
i++;
swap (arr[i], arr[j]);
}
}
swap (arr[i+1], arr[last]);
return (i+1);
}
template <class T>
void SortClass <T>::sort(T a[], int first, int last)
{
Stack stack;
stack.push (first);
stack.push (last);
while (not stack.isEmpty())
{
stack.pop(last);
stack.pop(first);
int s= split (a, first, last);
if (s-1>first )
{
stack.push(first);
stack.push(s-1);
}
if (s+1<last)
{
stack.push(s+1);
stack.push(last);
}
}
}
template <class T>
void SortClass <T>:: swap(T &a, T &b)
{
T temp=a;
a=b;
b=temp;
}
#ifndef UNIT_TEST
int main ()
{
const int N=10;
int x1[N]={1,3,5,6,4,2,8,9,7};
for (auto e: x1) std:: cout << e << " ";
std:: cout << std:: endl;
SortClass <int> s; s.sort(x1,0,N-1);
for (auto e: x1) std:: cout << e << " ";
std:: cout << std:: endl;
}
#endif
#ifdef UNIT_TEST
using Catch::Matchers::Equals;
TEST_CASE("A fast sort")
{
const int N = 6;
int x1[N] = { 1, 3, 5, 6, 4, 2 };
int x2[N] = { 1, 2, 3, 4, 5, 6 };
vector<int> v1(x1, x1 + N);
vector<int> v2(x2, x2 + N);
REQUIRE_THAT(v1, not Equals(v2));
SortClass<int> s;
s.sort(x1, 0, N - 1);
vector<int> v0(x1, x1 + N);
REQUIRE_THAT(v0, Equals(v2));
const int M = 100000;
int x3[M]; int x4[M];
ifstream ifs1("numbers");
for (auto &e : x3)
ifs1 >> e;
ifstream ifs2("sorted");
for (auto &e : x4)
ifs2 >> e;
s.sort(x3, 0, M - 1);
vector<int> v3(x3, x3 + M);
vector<int> v4(x4, x4 + M);
REQUIRE_THAT(v3, Equals(v4));
}
#endif
#define CATCH_CONFIG_MAIN Must be defined before #include "catch.hpp".
You have #define CATCH_CONFIG_MAI.

Installing ODEPACK on a Mac with C++ Code

I used homebrew to install R on my mac. My question is we have an example code that uses dlsode as a call, programmed in c++. When I compile I get linker errors. How would I properly link the library, and is the R package what I need to use ODEPACK calls?
The error-----
Undefined symbols for architecture x86_64:
"dlsode_(void ()(int, double*, double*, double*), int*, double*, double*, double*, int*, double*, double*, int*, int*, int*, double*, int*, int*, int*, void ()(int, double, double, int*, int*, double*, int*), int*)", referenced from:
_main in test-38f452.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Undefined symbols compiling in Mac OS X with Boost, GMP, and OpenMP

I'm having problems compiling a program called SDPB by following these instructions. To summarize, I'm installing a program that requires Boost, GMP, and OpenMP on Mac OS X Yosemite. All the individual pieces of code compile but when its time to link, I get Undefined symbols for architecture x86_64.
My question is basically identical to this question. However, I can't get the answers there to work for me. I still get the same error.
After more searching, I saw that people with similar questions were getting answers pointing to a conflict between clang and gcc. More specifically, there are issues with mixing the libraries libstdc++ and libc++.
Therefore, I made sure to recompile both Boost and GMP with gcc so that everything would be built using libstdc++. That didn't help. I then downloaded an implementation of clang that was compatible with OpenMP and tried to build everything using just libc++. That also didn't work. I then tried all sorts of permutations using clang with the -stdlib=libstdc++ flag and so on. Nothing seems to work. The details of the errors seemed to change a bit with the various permuations. I'll post a few snippets below. Of course, I always used the updated makefile to compile SDPB and I always configured GMP with the --enable-cxx flag as the answers linked above said to do.
Here, is a snippet of the error I received while compiling SDPB with gcc after I compiled GMP and Boost with gcc as well.
Undefined symbols for architecture x86_64:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned long) const", referenced from:
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::time_duration const&) const in SDPSolverIO.o
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::ptime const&) const in main.o
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_get_insert_unique_pos(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> const&) in SDPSolverIO.o
std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::timer::cpu_timer, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value> > >::find(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const in main.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_get_insert_unique_pos(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in main.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in main.o
...
Here, I compiled GMP and Boost using clang with the -stdlib=libstdc++ flag and I compiled SDPB with gcc.
Undefined symbols for architecture x86_64:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned long) const", referenced from:
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::time_duration const&) const in SDPSolverIO.o
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::ptime const&) const in main.o
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_get_insert_unique_pos(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> const&) in SDPSolverIO.o
std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::timer::cpu_timer, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value> > >::find(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const in main.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_get_insert_unique_pos(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in main.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in main.o
...
Here I compiled Boost, GMP, and SDPB using clang with the -stdlib=libstdc++ flag.
Undefined symbols for architecture x86_64:
"std::string::find(char const*, unsigned long, unsigned long) const", referenced from:
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::time_duration const&) const in SDPSolverIO.o
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::ptime const&) const in main.o
"std::logic_error::what() const", referenced from:
vtable for boost::gregorian::bad_day_of_year in main.o
vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::gregorian::bad_day_of_year> > in main.o
vtable for boost::exception_detail::error_info_injector<boost::gregorian::bad_day_of_year> in main.o
vtable for std::out_of_range in main.o
vtable for boost::gregorian::bad_day_of_month in main.o
vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::gregorian::bad_day_of_month> > in main.o
vtable for boost::exception_detail::error_info_injector<boost::gregorian::bad_day_of_month> in main.o
...
Here, I compiled everything using clang but only SDPB with the -stdlib=libstdc++ flag.
Undefined symbols for architecture x86_64:
"bootstrapSDP(std::vector<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, std::allocator<__gmp_expr<__mpf_struct [1], __mpf_struct [1]> > > const&, std::vector<PolynomialVectorMatrix, std::allocator<PolynomialVectorMatrix> > const&)", referenced from:
parseBootstrapSDP(tinyxml2::XMLElement*) in parse.o
"RpotrfStabilized(char const*, int, __gmp_expr<__mpf_struct [1], __mpf_struct [1]>*, int, int*, std::__1::vector<int, std::__1::allocator<int> >&, std::__1::vector<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, std::__1::allocator<__gmp_expr<__mpf_struct [1], __mpf_struct [1]> > >&, double)", referenced from:
choleskyDecompositionStabilized(Matrix&, Matrix&, std::__1::vector<int, std::__1::allocator<int> >&, std::__1::vector<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, std::__1::allocator<__gmp_expr<__mpf_struct [1], __mpf_struct [1]> > >&, double) in Matrix.o
"boost::program_options::to_internal(std::string const&)", referenced from:
std::vector<std::string, std::allocator<std::string> > boost::program_options::to_internal<std::string>(std::vector<std::string, std::allocator<std::string> > const&) in main.o
"boost::program_options::basic_parsed_options<char> boost::program_options::parse_config_file<char>(std::basic_istream<char, std::char_traits<char> >&, boost::program_options::options_description const&, bool)", referenced from:
_main in main.o
"boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)", referenced from:
_main in main.o
Whenever I tried to compile SDPB without the -stdlib=libstdc++ using the modified version of clang with OpenMP support, I kept running into many
error: 'value_type' is a private member of '__gmp_expr<mpf_t, mpf_t>'
__val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
^
src/serialize.h:48:10: note: while substituting deduced template arguments into function template 'operator<<' [with _Expr = __gmp_expr<mpf_t, mpf_t>]
os << f;
If anyone can help it would be much appreciated.
The Mac OS X Installation instructions have been updated and everything works now if I just blindly follow them to the letter.

Segmentation Fault gcc-4.9.1.RHEL6.4/include/c++/4.9.1/backward/auto_ptr.h:184

I am using Boost 1.56.0 for its dijkstra_shortest_paths in a c++ program (redhead 4.9.1, std = c++11). Somehow, I keep getting the following segmentation fault error in auto_ptr.h: 184
Program received signal SIGSEGV, Segmentation fault.
std::auto_ptr<boost::property<boost::edge_weight_t, double, boost::no_property> >::operator* (this=) at /opt/devl/optimize/gcc-4.9.1.RHEL6.4/include/c++/4.9.1/backward/auto_ptr.h:184
(gdb) bt
#0 std::auto_ptr<boost::property<boost::edge_weight_t, double, boost::no_property> >::operator* (this=) at /opt/devl/optimize/gcc-4.9.1.RHEL6.4/include/c++/4.9.1/backward/auto_ptr.h:184
#1 boost::detail::sep_<unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> >::get_property (this=) at /usr/include/boost/graph/detail/adjacency_list.hpp:278
#2 boost::detail::out_edge_iter<std::_List_iterator<boost::detail::sep_<unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> > >, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>::dereference (this=) at /usr/include/boost/graph/detail/adjacency_list.hpp:152
#3 boost::iterator_core_access::dereference<boost::detail::out_edge_iter<std::_List_iterator<boost::detail::sep_<unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> > >, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long> > (f=...) at /usr/include/boost/iterator/iterator_facade.hpp:516
#4 boost::iterator_facade<boost::detail::out_edge_iter<std::_List_iterator<boost::detail::sep_<unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> > >, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, boost::bidirectional_traversal_tag, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>::operator* (this=) at /usr/include/boost/iterator/iterator_facade.hpp:634
#5 boost::breadth_first_visit<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>, boost::d_ary_heap_indirect<unsigned long, 4ul, boost::iterator_property_map<unsigned long*, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long>, unsigned long, unsigned long&>, int*, std::less<int>, std::vector<unsigned long, std::allocator<unsigned long> > >, boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<boost::null_visitor>, boost::d_ary_heap_indirect<unsigned long, 4ul, boost::iterator_property_map<unsigned long*, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long>, unsigned long, unsigned long&>, int*, std::less<int>, std::vector<unsigned long, std::allocator<unsigned long> > >, boost::adj_list_edge_property_map<boost::directed_tag, double, double const&, unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> const, boost::edge_weight_t>, unsigned long*, int*, boost::closed_plus<int>, std::less<int> >, boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long> > > (g=..., s=0, Q=..., vis=..., color=...) at /usr/include/boost/graph/breadth_first_search.hpp:77
#6 boost::dijkstra_shortest_paths_no_init<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>, boost::dijkstra_visitor<boost::null_visitor>, unsigned long*, int*, boost::adj_list_edge_property_map<boost::directed_tag, double, double const&, unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> const, boost::edge_weight_t>, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long>, std::less<int>, boost::closed_plus<int>, int, boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long> > > (g=..., s=0, predecessor=, distance=, weight=..., index_map=...,
compare=..., combine=..., zero=0, vis=..., color=...) at /usr/include/boost/graph/dijkstra_shortest_paths.hpp:332
#7 boost::dijkstra_shortest_paths<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>, boost::dijkstra_visitor<boost::null_visitor>, unsigned long*, int*, boost::adj_list_edge_property_map<boost::directed_tag, double, double const&, unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> const, boost::edge_weight_t>, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long>, std::less<int>, boost::closed_plus<int>, int, int, boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long> > > (g=..., s=0, predecessor=, distance=, weight=..., index_map=...,
compare=..., combine=..., inf=2147483647, zero=0, vis=..., color=...) at /usr/include/boost/graph/dijkstra_shortest_paths.hpp:383
#8 boost::dijkstra_shortest_paths<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>, boost::dijkstra_visitor<boost::null_visitor>, unsigned long*, int*, boost::adj_list_edge_property_map<boost::directed_tag, double, double const&, unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> const, boost::edge_weight_t>, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long>, std::less<int>, boost::closed_plus<int>, int, int, int*, boost::vertex_distance_t, boost::bgl_named_params<unsigned long*, boost::vertex_predecessor_t, boost::no_property> > (g=..., s=0, predecessor=, distance=, weight=...,
index_map=..., compare=..., combine=..., inf=2147483647, zero=0, vis=...) at /usr/include/boost/graph/dijkstra_shortest_paths.hpp:353
#9 boost::detail::dijkstra_dispatch2<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>, int*, boost::adj_list_edge_property_map<boost::directed_tag, double, double const&, unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> const, boost::edge_weight_t>, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long>, boost::bgl_named_params<int*, boost::vertex_distance_t, boost::bgl_named_params<unsigned long*, boost::vertex_predecessor_t, boost::no_property> > > (g=..., s=0, distance=, weight=..., index_map=..., params=...) at /usr/include/boost/graph/dijkstra_shortest_paths.hpp:423
#10 boost::detail::dijkstra_dispatch1<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>, int*, boost::adj_list_edge_property_map<boost::directed_tag, double, double const&, unsigned long, boost::property<boost::edge_weight_t, double, boost::no_property> const, boost::edge_weight_t>, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long>, boost::bgl_named_params<int*, boost::vertex_distance_t, boost::bgl_named_params<unsigned long*, boost::vertex_predecessor_t, boost::no_property> > > (g=..., s=0, distance=, weight=..., index_map=..., params=...) at /usr/include/boost/graph/dijkstra_shortest_paths.hpp:455
#11 boost::dijkstra_shortest_paths<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>, int*, boost::vertex_distance_t, boost::bgl_named_params<unsigned long*, boost::vertex_predecessor_t, boost::no_property> > (g=..., s=0, params=...)
at /usr/include/boost/graph/dijkstra_shortest_paths.hpp:473
Would greatly appreciate it very much if you could help pointing out what I'm doing wrong.
It looks like somewhere you are using auto_ptr<>.
This type has been deprecated (for the reason that it's hardly possible to use it right and rarely safe). In particular: you can never use it inside standard libraries containers (because it fails readonly copy semantics).
Assuming you really need pointers there (why do you?) you should probably use ptr_vector, ptr_set etc. from the Boost Pointer Container library, or use a modern smart pointer (unique_ptr, value_ptr, scoped_ptr, shared_ptr
)

OpenCV Framework: symbol(s) not found for architecture armv7

I've got the precompiled opencv2.framework from OpenCV, and I've added it to my project. However trying to compile the project gives errors like:
Undefined symbols for architecture armv7:
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 128>, std::__1::allocator<cv::Vec<int, 128> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 64>, std::__1::allocator<cv::Vec<int, 64> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 32>, std::__1::allocator<cv::Vec<int, 32> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 16>, std::__1::allocator<cv::Vec<int, 16> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 12>, std::__1::allocator<cv::Vec<int, 12> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 9>, std::__1::allocator<cv::Vec<int, 9> > >::__append(unsigned long) in opencv2(matrix.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
cv::Exception::Exception(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) in opencv2(system.o)
cv::error(cv::Exception const&) in opencv2(system.o)
_cvRegisterModule in opencv2(system.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
cv::Exception::formatMessage() in opencv2(system.o)
"_OBJC_CLASS_$_ALAssetsLibrary", referenced from:
objc-class-ref in opencv2(cap_ios_video_camera.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
cv::sum(cv::_InputArray const&) in opencv2(stat.o)
cv::countNonZero(cv::_InputArray const&) in opencv2(stat.o)
cv::mean(cv::_InputArray const&, cv::_InputArray const&) in opencv2(stat.o)
cv::meanStdDev(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_InputArray const&) in opencv2(stat.o)
cv::minMaxIdx(cv::_InputArray const&, double*, double*, int*, int*, cv::_InputArray const&) in opencv2(stat.o)
cv::minMaxLoc(cv::_InputArray const&, double*, double*, cv::Point_<int>*, cv::Point_<int>*, cv::_InputArray const&) in opencv2(stat.o)
cv::norm(cv::_InputArray const&, int, cv::_InputArray const&) in opencv2(stat.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
cv::sum(cv::_InputArray const&) in opencv2(stat.o)
cv::countNonZero(cv::_InputArray const&) in opencv2(stat.o)
cv::mean(cv::_InputArray const&, cv::_InputArray const&) in opencv2(stat.o)
cv::meanStdDev(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_InputArray const&) in opencv2(stat.o)
cv::minMaxIdx(cv::_InputArray const&, double*, double*, int*, int*, cv::_InputArray const&) in opencv2(stat.o)
cv::minMaxLoc(cv::_InputArray const&, double*, double*, cv::Point_<int>*, cv::Point_<int>*, cv::_InputArray const&) in opencv2(stat.o)
cv::norm(cv::_InputArray const&, int, cv::_InputArray const&) in opencv2(stat.o)
...
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've set Build Active Architectures Only to No in my build settings, but it still happens. What do I need to do to get OpenCV working? I'm using XCode 5, targeting iOS7.
I've already added -lstdc++ to linker flags and switch the C++ compiler to libstdc++, as-per this answer.
I have tried compiling OpenCV from source too but that yields the same error.
It's the same regardless of whether I have iOS6 or 7 as the deployment target.
Two things you should check:
You're attempting to use the C++ portions of OpenCV but Xcode/clang are very literal. If the file you're linking with is a .m it'll treat it as an Objective-C. Instead we want to treat it as an Objective-C++ file by either renaming the extension to .mm or by bringing up the file's properties in the right side bar and selecting Objective-C++ Source for the Type.
ALAssetsLibrary is defined in AssetsLibrary.framework, please add it to your Link Binary With Libraries step for your project.

Resources