hi,<div><br></div><div>i've a problem with a simple Sip compilation ( and my first tentative )</div><div><br></div><div>a simple class:</div><div><br></div><div>//__________________________________</div><div><div>#ifndef Vector_h__</div>
<div>#define Vector_h__</div><div><br></div><div>namespace KitCG</div><div>{</div><div><br></div><div>class Vec2</div><div>{</div><div>public:<span class="Apple-tab-span" style="white-space:pre"> </span></div><div>//-------------------</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>// Access to elements</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>//-------------------</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>float<span class="Apple-tab-span" style="white-space:pre"> </span>x;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>float<span class="Apple-tab-span" style="white-space:pre"> </span>y;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>//-------------</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>// Constructors</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>//-------------</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Vec2 (); // no initialization</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>explicit Vec2 (float a); // (a a)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>Vec2 (float a, float b); // (a b)</div><div><br></div><div>};</div><div><br></div><div>Vec2::Vec2 ()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>// empty</div>
<div>}</div><div><br></div><div><br></div><div><br></div><div>Vec2::Vec2 (float a)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>x = y = a;</div><div>}</div><div><br></div><div><br></div>
<div><br></div><div>Vec2::Vec2 (float a, float b)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>x = a;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>y = b;</div>
<div>}</div><div>}</div><div><br></div><div>#endif // Vector_h__</div></div><div><br></div><div>//__________________________________</div><div><br></div><div><br></div><div>the corresponding Vector.sip</div><div><br></div>
<div>//_________________________________________________</div><div><div>%Module Vec2 0</div><div><br></div><div>class Vec2</div><div>{</div><div>%TypeHeaderCode</div><div>#include "Vector.h"</div><div>%End</div>
<div><br></div><div><br></div><div>public:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>float x;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>float y;</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Vec2 (); // no initialization</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>explicit Vec2 (float a); // (a a)</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>Vec2 (float a, float b); // (a b)</div><div><br></div><div><br></div><div>};</div></div><div>//_________________________________________________</div>
<div><br></div><div>My configure.py</div><div>//_________________________________________________</div><div><div>import os</div><div>import sipconfig</div><div>from PyQt4 import pyqtconfig</div><div><br></div><div>moduleName= "Vector"</div>
<div>build_file = moduleName+".sbf"</div><div><br></div><div>config = pyqtconfig.Configuration()</div><div><br></div><div>qt_sip_flags = config.pyqt_sip_flags</div><div><br></div><div>print " ".join([config.sip_bin, "-c", ".", "-b", build_file, moduleName+".sip"])</div>
<div><br></div><div>os.system(" ".join([config.sip_bin, "-c", ".", "-b", build_file, moduleName+".sip"]))</div><div><br></div><div>installs = []</div><div><br></div><div>installs.append([moduleName+".sip", os.path.join(config.default_sip_dir, moduleName)])</div>
<div><br></div><div>makefile = pyqtconfig.QtCoreModuleMakefile(</div><div> configuration=config,</div><div> build_file=build_file,</div><div> installs=installs</div><div> )</div><div><br></div><div>
makefile.extra_libs = [moduleName]</div><div><br></div><div>makefile.generate</div></div><div><br></div><div>//_________________________________________</div><div><br></div><div>and i've this error </div><div><br></div>
<div><br></div><div><div> cl -c -***************************************************************************</div><div>sipVec2Vec2.cpp</div><div>.\sipVec2Vec2.cpp(30) : error C2061: syntax error : identifier 'Vec2'</div>
<div>.\sipVec2Vec2.cpp(37) : error C2061: syntax error : identifier 'Vec2'</div><div>.\sipVec2Vec2.cpp(44) : error C2061: syntax error : identifier 'Vec2'</div><div>.\sipVec2Vec2.cpp(51) : error C2061: syntax error : identifier 'Vec2'</div>
<div>.\sipVec2Vec2.cpp(68) : error C2065: 'Vec2' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(68) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(73) : error C2065: 'sipCpp' : undeclared identifier</div>
<div>.\sipVec2Vec2.cpp(73) : error C2061: syntax error : identifier 'Vec2'</div><div>.\sipVec2Vec2.cpp(75) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(84) : error C2065: 'sipCpp' : undeclared identifier</div>
<div>.\sipVec2Vec2.cpp(84) : error C2061: syntax error : identifier 'Vec2'</div><div>.\sipVec2Vec2.cpp(86) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(96) : error C2065: 'sipCpp' : undeclared identifier</div>
<div>.\sipVec2Vec2.cpp(96) : error C2061: syntax error : identifier 'Vec2'</div><div>.\sipVec2Vec2.cpp(98) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(103) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int</div>
<div>.\sipVec2Vec2.cpp(103) : error C2143: syntax error : missing ';' before '*'</div><div>.\sipVec2Vec2.cpp(103) : error C2065: 'a0' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(105) : error C2065: 'a0' : undeclared identifier</div>
<div>.\sipVec2Vec2.cpp(107) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(107) : error C2061: syntax error : identifier 'Vec2'</div><div>.\sipVec2Vec2.cpp(109) : error C2065: 'sipCpp' : undeclared identifier</div>
<div>.\sipVec2Vec2.cpp(121) : error C2065: 'Vec2' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(121) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(121) : error C2061: syntax error : identifier 'Vec2'</div>
<div>.\sipVec2Vec2.cpp(123) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(123) : error C2227: left of '->x' must point to class/struct/union/generic type type is ''unknown-type''</div>
<div>.\sipVec2Vec2.cpp(133) : error C2065: 'Vec2' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(133) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(133) : error C2061: syntax error : identifier 'Vec2'</div>
<div>.\sipVec2Vec2.cpp(140) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(140) : error C2227: left of '->x' must point to class/struct/union/generic typetype is ''unknown-type''</div>
<div>.\sipVec2Vec2.cpp(150) : error C2065: 'Vec2' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(150) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(150) : error C2061: syntax error : identifier 'Vec2'</div>
<div>.\sipVec2Vec2.cpp(152) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(152) : error C2227: left of '->y' must point to class/struct/union/generic type type is ''unknown-type''</div>
<div>.\sipVec2Vec2.cpp(162) : error C2065: 'Vec2' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(162) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(162) : error C2061: syntax error : identifier 'Vec2'</div>
<div>.\sipVec2Vec2.cpp(169) : error C2065: 'sipCpp' : undeclared identifier</div><div>.\sipVec2Vec2.cpp(169) : error C2227: left of '->y' must point to class/struct/union/generic type type is ''unknown-type''</div>
</div><div><br></div><div><br></div><div><br></div><div>i know my problem is with the namespace, because without this, all is fine</div><div>i can compile and the python test is ok</div><div><br></div><div>could you explain me please, i don't understand why</div>
<div><br></div><div>thx for your help</div><div><br></div><div>Kermit</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>