[icpc/MKL] namespace has no member
Bonsoir,
Je développe à mes heures perdues une application basée sur l'utilisation de la bibliothèque MKL (Math Kernel Library). Mon projet se compose des fichiers suivants :
Citation:
../CXX_MATH
- main.cpp
- cxx_math_matrix.cpp
- cxx_math_utils.cpp
../CXX_MATH/includes
- cxx_math_matrix.h
- cxx_math_utils.h
J'ai défini un espace de nom cxx_math dans lequel j'ai défini une classe t_matrix (déclarée dans le fichier cxx_math_matrix.h et implémentée dans le .cpp) ainsi que quelques fonctions lambda.
Pour mon fichier cxx_math_utils.h :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
#ifndef CXX_MATH_UTILS_H_INCLUDED
#define CXX_MATH_UTILS_H_INCLUDED
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "cxx_math_matrix.h"
namespace cxx_math
{
// id:
// returns the identity matrix
t_matrix id(MKL_INT order);
}
#endif |
et pour mon fichier cxx_math_matrix.h :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#ifndef CXX_MATH_MATRIX_H_INCLUDED
#define CXX_MATH_MATRIX_H_INCLUDED
#include <stdlib.h>
#include <stdio.h>
#include "mkl.h"
#include "mkl_cblas.h"
#include "mkl_lapacke.h"
#include "cxx_math_utils.h"
namespace cxx_math
{
/*
* class t_matrix:
* represents a m*n matrix
*/
class t_matrix
{
public:
...
}
}
#endif |
Ma classe est donc bien déclarée dans l'espace de nom cxx_math.
Lorsque je compile mon projet (via icpc) au moyen de la commande :
Citation:
icpc main.cpp cxx_math_matrix.cpp cxx_math_utils.cpp -Iincludes/ -lm -lmkl_rt -mkl=parallel -O3
j'obtiens l'erreur
Citation:
includes/cxx_math_utils.h(29): error: identifier "t_matrix" is undefined
t_matrix id(MKL_INT order);
Pourtant, la classe t_matrix est bel et bien définie...
Lorsque j'insère le prototype de la classe dans le fichier cxx_math_utils, en ajoutant simplement class t_matrix;, ça fonctionne mais ça reste du bricolage.
Que faire ?
En vous remerciant d'avance,
Nicolas.