Je n'ai aucun problème la compilation du code spécifique de la manière suivante:Howto incorporer -I makefile
g++ -I /opt/local/include Code1.cc -o Code1
Cependant quand j'ai essayé de le faire dans le makefile:
CXX = g++ -Wall -Werror -gstabs -pedantic -O2 -g
all: Code3 Code2 Code1
Code3: Code3.cc Tools.cc
$(CXX) $^ -o [email protected]
Code2: Code2.cc Tools.cc
$(CXX) $^ -o [email protected]
Code1: Code1.cc Tools.cc
$(CXX) -I /opt/local/include $^ -o [email protected]
Il se plaint. Quelle est la bonne façon de le faire? Notez que seul Code1.cc nécessite la bibliothèque externe comme incluse.
L'en-tête de Code1.cc ressemble à ceci:
#include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <boost/math/distributions/chi_squared.hpp>
using namespace std;
using boost::math::chi_squared;
using boost::math::quantile;
L'erreur que je reçois est la suivante:
g++ -Wall -Werror -gstabs -pedantic -O2 -g -I/opt/local/include Code1.cc Tools.cc -o EstimateErrorMean
In file included from /opt/local/include/boost/detail/lcast_precision.hpp:16,
from /opt/local/include/boost/lexical_cast.hpp:31,
from /opt/local/include/boost/math/special_functions/gamma.hpp:23,
from /opt/local/include/boost/math/distributions/chi_squared.hpp:13,
from EstimateErrorMean.cc:19:
/opt/local/include/boost/integer_traits.hpp:164:66: error: use of C99 long long integer constant
/opt/local/include/boost/integer_traits.hpp:164:77: error: use of C99 long long integer constant
/opt/local/include/boost/integer_traits.hpp:170:70: error: use of C99 long long integer constant
@rkb: suppression des travaux pédantes, mais pas #include –
neversaint