Very simple question, I think, but I have started to learn C++ two days ago... I am trying to use the Armadillo library. I write a .cpp file and I have no problem compiling it from the terminal, using
g++ main.cpp -o main -01 -larmadillo
However, when I try to run the code from XCode, I always get the error that 'armadillo file not found', but I don't know how to link Xcode to Armadillo to make it work... The code is just this,
kaseron, it is a linear algebra library, that makes C++ coding closer to MATLAB (for people like me it is a great advantage) http://arma.sourceforge.net/
Aceix, now it recognizes the file (I added "/usr/include/armadillo"). But now I have other problem... when it is compiling, I get this error:
"Lexical or Preprocessor issue: 'initializer_list' not found. The error is given in the armadillo file,
// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2012 Conrad Sanderson
//
// This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness
// for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3
// of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info)
#ifndef ARMA_INCLUDES
#define ARMA_INCLUDES
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <limits>
#include <algorithm>
#include <complex>
#include <vector>
#include "armadillo_bits/config.hpp"
#include "armadillo_bits/compiler_setup.hpp"
#include "armadillo_bits/undefine_conflicts.hpp"
#if defined(ARMA_USE_CXX11)
#include <initializer_list>
#endif
#if !defined(ARMA_HAVE_GETTIMEOFDAY) && !defined(ARMA_USE_BOOST_DATE)
#include <ctime>
#endif
Ok...so, I could not make it work. However, I switched to Eclipse, and everything works fine there! I guess that no more Xcode for me (unless anyone has an idea on how to resolve my previous issue...)