Hello,
I have a problem compiling rev 2706 (06/12/09), in src/Mod/Mesh/Gui/CMakeFiles/MeshGui.dir/RemoveComponents.cpp:
I'm on a Debian Squeeze, and the compiler is gcc version 4.3.4 (Debian 4.3.4-6). Below is the compiler error message:
src/Mod/Mesh/Gui/RemoveComponents.cpp: In member function ‘void MeshGui::RemoveComponents::on_selectAll_clicked()’:
src/Mod/Mesh/Gui/RemoveComponents.cpp:153: error: no matching function for call to ‘generate(__gnu_cxx::__normal_iterator<long unsigned int*, std::vector<long unsigned int, std::allocator<long unsigned int> > >, __gnu_cxx::__normal_iterator<long unsigned int*, std::vector<long unsigned int, std::allocator<long unsigned int> > >, MeshGui::RemoveComponents::on_selectAll_clicked()::iotaGen&)’
It's as if the compiler could'nt instantiate the 'generate' function. More precisely, it doesn't recognise iota_gen as a 'Generator'.
If struct iotaGen definition and iota_gen declaration are pushed out of on_selectAll_clicked() function body, everything is fine.
I don't quite understand why, but I'm not very cute in C++.
Are some of you running across the same problem ?
Does anybody know why that seemingly correct syntax is not taken by g++ ?
STL question
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: STL question
I have the same problem on openSuse. We will look into that!
Jürgen
Jürgen
Stop whining - start coding!
Re: STL question
I'm conscious that it doesn't look too nice, but do you consider it a complete heresy if iotaGen definition appears outside the function, like below:
at least as a rough fix to compile.
Cheers
Code: Select all
typedef struct iotaGen {
unsigned long operator()() { return n++; }
iotaGen() : n(0) {}
private:
unsigned long n;
} iotaGen_t;
void RemoveComponents::on_selectAll_clicked()
{
// select the complete meshes
iotaGen_t iota_gen;
...
}
Cheers
Re: STL question
In the latest SVN revision this is fixed.