Boost logo

Boost Users :

Subject: Re: [Boost-users] Compile errors including boost/regex.hpp
From: John Maddock (john_at_[hidden])
Date: 2013-05-22 11:53:31


> # /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 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