Boost logo

Boost Users :

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

When I try to compile a file that includes <boost/regex.hpp> I get the
following error:

# /home/me/Projects/myproject> make
# /usr/bin/make all-am
# make[1]: Entering directory `/home/me/Projects/myproject'
# compiling main.cpp (g++)
# In file included from
/usr/local/include/boost/regex/regex_traits.hpp:27:0,
# from /usr/local/include/boost/regex/v4/regex.hpp:39,
# from /usr/local/include/boost/regex.hpp:31,
# [ ... more traceback ... ]
#
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error: macro
"test" passed 2 arguments, but
# takes just 1
# In file included from /usr/local/include/boost/regex/v4/regex.hpp:79:0,
# from /usr/local/include/boost/regex.hpp:31,
# [ ... more traceback ... ]
#
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error: macro
"test" passed 2 arguments, but
# takes just 1
# In file included from
/usr/local/include/boost/regex/regex_traits.hpp:27:0,
# from /usr/local/include/boost/regex/v4/regex.hpp:39,
# from /usr/local/include/boost/regex.hpp:31,
# [ ... more traceback ... ]
#
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
template declaration of ‘char (&
# boost::re_detail::test)[2]’
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
expected unqualified-id before ‘...’
# token
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
expected ‘)’ before ‘...’ token
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
expected ‘)’ before ‘...’ token
# /usr/local/include/boost/regex/v4/regex_traits.hpp:87:1: error:
expected unqualified-id before ‘(’
# token
# In file included from /usr/local/include/boost/regex/v4/regex.hpp:79:0,
# from /usr/local/include/boost/regex.hpp:31,
# [ ... more traceback ... ]
#
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
template declaration of ‘char (&
# boost::re_detail::test)[2]’
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
expected unqualified-id before ‘...’
# token
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
expected ‘)’ before ‘...’ token
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
expected ‘)’ before ‘...’ token
# /usr/local/include/boost/regex/v4/regex_format.hpp:849:1: error:
expected unqualified-id before ‘(’
# token
# make[1]: *** [myproject-main.o] Error 1
# make[1]: Leaving directory `/home/me/Projects/myproject'
# make: *** [all] Error 2
# *** Failure: Exit code 2 ***

This is how I'm compiling:

# g++ -DHAVE_CONFIG_H -I. `mysql_config --include` `mysql_config
--cflags` -std=c++0x -g -O2 -MT
# myproject-main.o -MD -MP -MF .deps/myproject-main.Tpo -c -o
myproject-main.o `test -f 'src/main.cpp'
# || echo './'`src/main.cpp

Basically, the compile errors trace back to when I include boost/regex.hpp:
| #include <boost/regex.hpp>

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.

Thanks. Sorry for the lengthy email.
-----BEGIN PGP SIGNATURE-----

iQEcBAEBCgAGBQJRnN/nAAoJEOT99oqiSuRNim0H/1U+xgx+TCwOtDiGfC5FH6yR
1HwZYwTb0F/7CwldOBsPoDMfjSJmptH4a4s84PR0xDHFrhvgDkjDvzYkoWPLR7gf
eSAMHzQG3kvJawvHiJNSu/eTZivVfkCE14+zoE+cVriCJicJUJg1g8hp5Cydk6D3
OM9WtOY/GCVHD8lK84UX5HMqnjeX4nPLEA7nJGd1u2+5PkHxpQMF2RO+EWnlNm0e
eTUdZBlGLc/RGHMgl2uF1q3b+qCRrC/Wwn/4OtkDUn0Y3V879LbkYej06oB94zWD
9kKHAnTFOisQJDUmkHr9BiEGgJ9UNO2JCVkHlzrjVgfwKe1r6FIaZmTGNpIme0c=
=Av+g
-----END PGP SIGNATURE-----


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