Bonjour,
J'utilise une bibliothèque libcrn qui cette dernière utilise pkg-config, je l'ai compilée sous MSYS (windows 7) et apparemment elle a fonctionné.
Dans le .pro, j'ai ajouté les lignes suivante
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
CONFIG    += link_pkgconfig
PKGCONFIG += gtk+-2.0 libcrn
INCLUDEPATH +=  "C:/libcrn-1.0.0/src/libcrn"
LIBS += "C:/libcrn-1.0.0/src/libcrn/.libs/libcrn.dll.a"
Mais après lorsque j'ajoute include (#include "CRNImage/CRNImage.h"), la sortie de compilation est la suivante:
Code : 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
In file included from ..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:28,
                 from ..\..\libcrn-1.0.0\src\libcrn/CRNObject.h:28,
                 from ..\..\libcrn-1.0.0\src\libcrn/CRNComplexObject.h:25,
                 from ..\..\libcrn-1.0.0\src\libcrn/CRNImage/CRNImage.h:25,
                 from ..\DIGIDOC\segment_r.cpp:9:
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:36: error: ISO C++ forbids declaration of 'DynamicCast' with no type
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:36: error: 'crn::DynamicCast' declared as an 'inline' variable
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:36: error: template declaration of 'int crn::DynamicCast'
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:36: error: 'in' was not declared in this scope
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:50: error: ISO C++ forbids declaration of 'StaticCast' with no type
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:50: error: 'crn::StaticCast' declared as an 'inline' variable
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:50: error: template declaration of 'int crn::StaticCast'
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:50: error: 'in' was not declared in this scope
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:64: error: ISO C++ forbids declaration of 'ReinterpretCast' with no type
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:64: error: 'crn::ReinterpretCast' declared as an 'inline' variable
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:64: error: template declaration of 'int crn::ReinterpretCast'
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:64: error: 'in' was not declared in this scope
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:78: error: ISO C++ forbids declaration of 'ConstCast' with no type
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:78: error: 'crn::ConstCast' declared as an 'inline' variable
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:78: error: template declaration of 'int crn::ConstCast'
..\..\libcrn-1.0.0\src\libcrn/CRNSmartPointer/CRNCast.h:78: error: 'in' was not declared in this scope
In file included from ..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:53,
                 from ..\..\libcrn-1.0.0\src\libcrn/CRNObject.h:28,
                 from ..\..\libcrn-1.0.0\src\libcrn/CRNComplexObject.h:25,
                 from ..\..\libcrn-1.0.0\src\libcrn/CRNImage/CRNImage.h:25,
                 from ..\DIGIDOC\segment_r.cpp:9:
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h: In constructor 'TiXmlString::TiXmlString(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:95: error: 'StaticCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:95: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h: In member function 'TiXmlString& TiXmlString::operator+=(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:128: error: 'StaticCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:128: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h: In member function 'size_t TiXmlString::find(char, size_t) const':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:190: error: 'StaticCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:190: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h: In member function 'void TiXmlString::init(size_t, size_t)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:245: error: 'ReinterpretCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:245: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:245: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h: In member function 'void TiXmlString::quit()':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:262: error: 'ReinterpretCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:262: error: expected primary-expression before 'int'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinystr.h:262: error: expected ')' before 'int'
In file included from ..\..\libcrn-1.0.0\src\libcrn/CRNObject.h:28,
                 from ..\..\libcrn-1.0.0\src\libcrn/CRNComplexObject.h:25,
                 from ..\..\libcrn-1.0.0\src\libcrn/CRNImage/CRNImage.h:25,
                 from ..\DIGIDOC\segment_r.cpp:9:
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlNode* TiXmlNode::FirstChild(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:527: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:527: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:527: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:527: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:527: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:527: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:527: error: expected ')' before ';' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlNode* TiXmlNode::LastChild(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:534: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:534: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:534: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:534: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:534: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:534: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:534: error: expected ')' before ';' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlNode* TiXmlNode::IterateChildren(TiXmlNode*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:562: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:562: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:562: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:562: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:562: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:562: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:562: error: expected ')' before ';' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlNode* TiXmlNode::IterateChildren(const char*, TiXmlNode*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:568: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:568: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:568: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:568: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:568: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:568: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlNode* TiXmlNode::PreviousSibling(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:618: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:618: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:618: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:618: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:618: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:618: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlNode* TiXmlNode::NextSibling(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:635: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:635: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:635: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:635: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:635: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:635: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlElement* TiXmlNode::NextSiblingElement()':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:644: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:644: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:644: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:644: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:644: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:644: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlElement* TiXmlNode::NextSiblingElement(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:653: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:653: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:653: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:653: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:653: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:653: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlElement* TiXmlNode::FirstChildElement()':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:664: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:664: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:664: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:664: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:664: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:664: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlElement* TiXmlNode::FirstChildElement(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:670: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:670: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:670: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:670: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:670: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:670: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlDocument* TiXmlNode::GetDocument()':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:689: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:689: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:689: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:689: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:689: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:689: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlAttribute* TiXmlAttribute::Next()':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:849: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:849: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:849: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:849: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:849: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:849: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlAttribute* TiXmlAttribute::Previous()':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:855: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:855: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:855: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:855: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:855: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:855: error: expected ')' before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h: In member function 'TiXmlAttribute* TiXmlAttributeSet::Find(const char*)':
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:917: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:917: error: expected primary-expression before '*' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:917: error: expected primary-expression before '>' token
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:917: error: 'ConstCast' is not a member of 'crn'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:917: error: expected primary-expression before 'const'
..\..\libcrn-1.0.0\src\libcrn/tinyxml/tinyxml.h:917: error: expected ')' before 'const'
mingw32-make.exe[1]: Leaving directory `C:/workspace/DIGIDOC-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug'
mingw32-make.exe[1]: *** [debug/segment_r.o] Error 1
mingw32-make.exe: *** [debug] Error 2
Sous linux et MINGW:
*La commande "pkg-config --cflags libcrn" imprime la liste des paramètres à fournir au compilateur, à savoir les path des include ainsi que les options de compilation (en particulier un certain nombre de flags sans lesquels on obtient les erreurs ci-dessous).

*La commande "pkg-config --libs libcrn" imprime la liste des paramètres à fournir au linker, à savoir les path des dll et les dll à lier.

À défaut de pouvoir utiliser pkg-config directement dans le gestionnaire de projet sous windows il faudra adapter manuellement les informations données par les deux commandes précédentes pour les ajouter à la configuration du projet.
Quelqu'un pourra m'aider à résoudre le problème?
Merci.
Cordialement,
Maroua