On Sun, Apr 20, 2008 at 07:49:28PM +0000, 7stud wrote:
And when I try running the program in the Xcode 2.4 IDE, I get different errors. I added the directory /usr/local/boost_1_34_1 to the Project Settings under:
Project>Edit Project Settings Collection: Search Paths Header Search Paths /usr/local/boost_1_34_1/**
And when I run the program, I get an error for the line:
typedef std::istream_iterator<int> in;
which says:
error: expected initializer before token '<' token
It works for me. Please check that you use indeed a C++ compiler not a C one. Maybe adding (after all other #include-statements in the example) #include <iterator> helps to make this error go away?
And I get an error for the line:
std::for_each(in(std::cin), in(), std::cout << (_1 * 3) << " " );
which says:
error: for_each is not a member of 'std'
for_each is defined in algorithm which is included ... Try: #include <iostream> int main() { std::cout << "Hello World. This is my first C++ program\n"; return 0; } Jens