Boost logo

Boost Users :

Subject: Re: [Boost-users] Compile errors including boost/regex.hpp
From: Jordan H. (jordannh_at_[hidden])
Date: 2013-05-22 12:05:46


I did #include <boost/regex.hpp> as the first include statement.
I'm the only one writing this program. I haven't defined a macro "test"
anywhere. I even grepped for 'test' and found it only used as the BASH
command "test" in configure and Makefile files (automatically generated
from autotools).

On Wed 22 May 2013 08:53:31 AM PDT, John Maddock wrote:
>> # /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error: macro
>> "test" passed 2 arguments, but
>> # takes just 1
>
>
>> Any ideas why this occurs? Maybe it's because I'm not including
>> -lbooost_regex as a compile option? I specified it as my
>> "myproject_LDADD" macro in Makefile.am so I assume g++ knows when to
>> use it.
>
> Yes you need to add -lboost_regex as a *linker* option, but the error
> is occuring because someone has defined "test" as a macro which is a
> very very bad idea! Try making boost/regex.hpp the first #include.
>
> HTH, John.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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