Boost logo

Boost Users :

Subject: Re: [Boost-users] can't get first example in boost tutorial to work
From: daehlerr (r.daehler-wilking_at_[hidden])
Date: 2013-03-10 21:05:05


I had the same problem with the same error messages when trying to compile
the first sample program from the Boost getting-started tutorial in Eclipse
using the MinGW GNU g++ compiler in Microsoft Windows. I finally found an
explanation of what's going on at the MinGW website posting "HOWTO Specify
the Header File Include Path for use with MinGW Compilers" at
http://www.mingw.org/wiki/IncludePathHOWTO .

  It turns out that MinGW doesn't read the Windows "Include" environment
variable. You have to specify the boost home directory using one of the
ways described in the section "Including Headers from Directories which are
Not Searched by Default" which is about two-thirds of the way down the page.

  In my case, I opened up the Properties window for my project, then went to
[C/C++ General > Paths and Symbols], where I found a tab labeled [Includes].
I clicked on the language I'm using (GNU C++), then the [Add..] on the right
side of the pane. There, I entered the directory name (on my system, it is
C:\Programm Files\Boost_1_53_0 ).

  After I did that, things went more smoothly, but I still got one more
error message. A compilation message popped up (generated by the source
code, not the compiler itself) explaining that the Boost library required
another setting on the command line (either " -std=c++11" or "
-std=gnu++11"). Back in the Properties window, this time under [C/C++ Build
> Discovery Options] I accepted the configuration (Debug [Active]) and
selected the tool (GCC C++ Compiler). Down near the bottom of the pane is a
field titled "Compiler invocation arguments". To the text that was already
there I appended " -std=gnu++11" (or maybe it was " -std=c++11" ? They're
both there now.)

I hope this helps!

Richard Daehler-Wilking

--
View this message in context: http://boost.2283326.n4.nabble.com/can-t-get-first-example-in-boost-tutorial-to-work-tp2576126p4643996.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net