Boost logo

Boost Users :

Subject: [Boost-users] Using boost library on MacOSx
From: Richard L. Aurbach (rick_at_[hidden])
Date: 2009-07-24 11:50:40


On Jul 24, 2009, at 10:30 AM, boost-users-request_at_[hidden] wrote:

> I have install boost library using this:
> $ sudo port install boost
> It seems download and compile fine on my local machine.
>
> But then i tried to compile a simple echo client example from
> http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/examples.html
>
> I get a bunch of compiler errors. I am using "g++ -o block_client
> blocking_udp_echo_client.cpp "
>
> Here are some of the errors:
> $ g++ -o block_client blocking_udp_echo_client.cpp
> blocking_udp_echo_client.cpp:68:10: error: #include expects "FILENAME"
> or <FILENAME>
> blocking_udp_echo_client.cpp:69:10: error: #include expects "FILENAME"
> or <FILENAME>
> blocking_udp_echo_client.cpp:70:10: error: #include expects "FILENAME"
> or <FILENAME>
> blocking_udp_echo_client.cpp:71:10: error: #include expects "FILENAME"
> or <FILENAME>
> blocking_udp_echo_client.cpp:83: error: stray ‘\’ in program
> blocking_udp_echo_client.cpp:108: error: stray ‘\’ in program
> blocking_udp_echo_client.cpp:112: error: stray ‘\’ in program
>
> Thank you for any help.

 From my experience building software on MacOSX, I suspect that the
problem is that you have not correctly defined an environment variable
or something like that. If you write a line like "#include <boost/
blah>" and the compiler either cannot correctly resolve 'boost' or if
the symbol resolves in such a way that an invalid file specification
is created, then you might get the kind of error message that you are
seeing.

Another possibility -- if you have code left over from Windoze, look
for backslashes in file specs. MacOSX is a Unix-like system that
requires SLASHES, not BACKSLASHES. So lines line "#include <boost
\header.h> will NOT work.

Cheers,

Rick Aurbach, Ph.D.
President and Chief Engineer
Aurbach & Associates, Inc.
8233 Tulane Avenue, Suite B
St. Louis, MO 63132

www: http://www.aurbach.com/
eMail: support_at_[hidden] [business]
                rick_at_[hidden] [personal]
Fax: 314/678-0869
Phone: 800/774-7239
                 314/726-1321

"Cowardice asks the question, 'Is it safe?' Expediency asks the
question, 'Is it politic?' Vanity asks the question, 'Is it popular?'
But, conscience asks the question, 'Is it right?' And there comes a
time when one must take a position that is neither safe, nor politic,
nor popular but one must take it because one's conscience tells one
that it is right." -Martin Luther King, Jr.

"If in the last few years you haven't discarded a major opinion or
acquired a new one, check your pulse. You may be dead." - Gelett
Burgess (1866-1951)

"A life spent making mistakes is not only more honorable, but more
useful than a life spent doing nothing." - George Bernard Shaw
(1856-1950)



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