Hi Kuba,
for whatever reason I get the message

selection.cpp:675:10: error: ‘for_each’ is not a member of ‘std’

this is what make executes:
g++ -c -m64 -pipe -O2 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables -g
-Wall -W -D_REENTRANT -DRESOURCES_DIR=\"/usr/lib/xcircuit-3.7\"
-DBUILTINS_DIR=\"/usr/lib/xcircuit-3.7\"
-DPROLOGUE_DIR=\"/usr/lib/xcircuit-3.7\"
-DPROLOGUE_FILE=\"xcircps2.pro\"
-DSCRIPTS_DIR=\"/usr/lib/xcircuit-3.7\"
-DSTARTUP_FILE=\"startup.script\" -DUSER_RC_FILE=\".xcircuitrc\"
-DGS_EXEC=\"gs\" -DTEMP_DIR=\"/tmp\" -DPROG_REVISION=8
-DPROG_VERSION=3.7 -DHAVE_DIRENT_H=1 -DHAVE_U_CHAR=1 -DXC_QT=1
-DHAVE_LIBZ=1 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore
-I/usr/include/QtGui -I/usr/include -I. -o selection.o selection.cpp

I thought maybe I am missing a development library or two so I found a
snippet using for_each to test:

// for_each example
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

void myfunction (int i) {
  cout << " " << i;
}

struct myclass {
  void operator() (int i) {cout << " " << i;}
} myobject;

int main () {
  vector<int> myvector;
  myvector.push_back(10);
  myvector.push_back(20);
  myvector.push_back(30);

  cout << "myvector contains:";
  for_each (myvector.begin(), myvector.end(), myfunction);
  // or:
  cout << "\nmyvector contains:";
  for_each (myvector.begin(), myvector.end(), myobject);

  cout << endl;

  return 0;
}

and that one works perfectly with g++, so I don't think I am missing
any library. I have never used for_each before so I don't know what I
am missing out. On pure trial-and-error I included a
#include <algorithm>
to selection.cpp and then at least that file compiled.

Kind regards,
-- 
Svenn

_______________________________________________
Xcircuit-dev mailing list
[email protected]
http://www.opencircuitdesign.com/mailman/listinfo/xcircuit-dev

Reply via email to