user2897535
user2897535

Reputation: 83

initializer_list: No such file or directory

I want to include matrix library to my project, but when i include matrix.h and matrix.hpp here are errors :

 initializer_list: No such file or directory
 error: tuple: No such file or directory
error: type_traits: No such file or directory

Lines

#include <initializer_list>
#include <algorithm>
#include <tuple>
#include <memory>
#include <iostream>
#include <string>
#include <type_traits>

truble it. Help,plz. I think here is some kind of problem with standards

gcc 4.8; Mac OS

Upvotes: 1

Views: 4561

Answers (1)

Pierre Fourgeaud
Pierre Fourgeaud

Reputation: 14510

Since you are using GCC-4.8 and your problem is that you don't have the C++11 features try to add -std=c++11 to your compilation line.

I saw that you are using CMake, then this post may help you (you can replace -std=c++0x by -std=c++11 or -std=gnu++11).

Example:

# It appends the -std=c++11 option to CMAKE_CXX_FLAGS
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # for gcc >= 4.7

# Or
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") # for gcc < 4.7

Upvotes: 4

Related Questions