Bonjour,
Je bloque sur un problème avec un namespace que j'ai créé :
2 fichiers f1 et f2 déclarent respectivement 2 classes c1 et c2 dans le même namespace np.
mais quand je déclare dans c1 une méthode
void doSomething(np::c2^ obj)
Il a le culot de me sortir une erreur C2039 c2 n'est pas un membre de np ...
Le code des entêtes si ça vous aide :
Code Layer_Part_wrapper.h : Sélectionner tout - Visualiser dans une fenêtre à part
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 #pragma once #include <vector> #include <string> #include <vcclr.h> #include <windows.h> #include "Layer_part.h" #include "Map_wrapper.h" namespace MapnikWrap { public ref class Layer_Part_wrapper { private: System::String^ _filter; int _order; Layer_part* _lp; public: Layer_Part_wrapper(System::String^ expression_filter, int order); void addPolygon(System::String^ expr_filter, int order, int fillColor); void addLine(System::String^ expr_filter, int order, int color, double width, int dash_type); void applyStylesToMap(MapnikWrap::Map_wrapper^ map); }; }
Code Map_wrapper.h : Sélectionner tout - Visualiser dans une fenêtre à part
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 #pragma once //#define BOOST_SPIRIT_THREADSAFE //This trick keeps freetype.h from crashing due to a generic reserved word useage //#define generic GENERIC #pragma managed(push, off) #include <mapnik/map.hpp> #include <mapnik/color.hpp> #pragma managed(pop) //#undef GENERIC #include "Layer_Part_wrapper.h" namespace MapnikWrap { public ref class Map_wrapper { private : mapnik::Map* _map; public: Map_wrapper(void); Map_wrapper(int width, int height, int backColor); Map_wrapper(int width, int height, int backColor, System::String^ coordSysType); mapnik::Map* getMap(); }; }
L'erreur se situe dans Layer_Part_wrapper.h à la déclaration de void applyStylesToMap(MapnikWrap::Map_wrapper^ map);
Sois-disant "Map_Wrapper" n'est pas un membre de MapnikWrap ... alors que l'auto-complétion elle-même me propose bien la classe ...
je m'en remets à vous![]()
Partager