
Jens Seidel <jensseidel <at> users.sf.net> writes:
On Sun, Apr 20, 2008 at 03:35:27AM +0000, 7stud wrote:
Following the instructions in the tutorial, I installed boost in /usr/local as instructed, so my directory structure is:
/usr/local/boost_1_34_1/boost
I also tried to execute the program from the command line with the original include path:
#include <boost/lambda/lambda.hpp>
but I get the same error:
~/2testing/dir1$ g++ prog1.cpp prog1.cpp:1:35: error: boost/lambda/lambda.hpp:
You need of course to specify /usr/local/boost_1_34_1 as include path via -isystem /usr/local/boost_1_34_1 or -I /usr/local/boost_1_34_1 so that the compiler knows where to find boost header files.
Jens
Here is the tutorial example: #include <boost/lambda/lambda.hpp> #include <iostream> #include <iterator> #include <algorithm> int main() { using namespace boost::lambda; typedef std::istream_iterator<int> in; std::for_each(in(std::cin), in(), std::cout << (_1 * 3) << " " ); return 0; } And this is what happens: gcc -I /usr/local/boost_1_34_1 prog1.cpp /usr/bin/ld: Undefined symbols: std::basic_ios<char, std::char_traits<char> >::operator void*() const std::basic_istream<char, std::char_traits<char> >::operator>>(int&) std::basic_ostream<char, std::char_traits<char> >::operator<<(int) std::ios_base::Init::Init() std::ios_base::Init::~Init() std::cin std::cout std::basic_ostream<char, std::char_traits<char> > & std::operator<< <std::char_traits<char> > (std::basic_ostream<char, std::char_traits<char> >&, char const*) ___gxx_personality_v0 collect2: ld returned 1 exit status