regex_replace not found
I installed boost_1_31_0 on Red Hat Fedora Core 1 with no apparent errors. I can compile and run the examples in /usr/local/src/boost_1_31_0/libs/date_time/example and I have compiled and run some graph examples so I think it is installed OK. However when I compile /usr/local/src/boost_1_31_0/libs/regex/example/snippets/credit_card_example.cpp (or anything that uses regex_replace) I get the following error: [root@athlon snippets]# g++ credit_card_example.cpp credit_card_example.cpp: In function `std::string machine_readable_card_number(const std::string&)': credit_card_example.cpp:35: error: `regex_replace' undeclared in namespace ` boost' credit_card_example.cpp: In function `std::string human_readable_card_number(const std::string&)': credit_card_example.cpp:40: error: `regex_replace' undeclared in namespace ` boost' TIA Scott
I installed boost_1_31_0 on Red Hat Fedora Core 1 with no apparent errors. I can compile and run the examples in /usr/local/src/boost_1_31_0/libs/date_time/example and I have compiled and run some graph examples so I think it is installed OK. However when I compile
/usr/local/src/boost_1_31_0/libs/regex/example/snippets/credit_card_example. cpp
(or anything that uses regex_replace) I get the following error:
[root@athlon snippets]# g++ credit_card_example.cpp credit_card_example.cpp: In function `std::string machine_readable_card_number(const std::string&)': credit_card_example.cpp:35: error: `regex_replace' undeclared in namespace
`
boost' credit_card_example.cpp: In function `std::string human_readable_card_number(const std::string&)': credit_card_example.cpp:40: error: `regex_replace' undeclared in namespace ` boost'
My suspicion is that you have an older version on your hard drive whose headers are being picked up rather than those 1.31.0, try pre-processing the source, and filtering the result through less, you should then be able to work out what's going wrong, John.
John Maddock wrote:
I installed boost_1_31_0 on Red Hat Fedora Core 1 with no apparent
errors.
I can compile and run the examples in /usr/local/src/boost_1_31_0/libs/date_time/example and I have compiled and run some graph examples so I think it is installed OK. However when I compile
/usr/local/src/boost_1_31_0/libs/regex/example/snippets/credit_card_example. cpp
(or anything that uses regex_replace) I get the following error:
[root@athlon snippets]# g++ credit_card_example.cpp credit_card_example.cpp: In function `std::string machine_readable_card_number(const std::string&)': credit_card_example.cpp:35: error: `regex_replace' undeclared in namespace
`
boost' credit_card_example.cpp: In function `std::string human_readable_card_number(const std::string&)': credit_card_example.cpp:40: error: `regex_replace' undeclared in namespace
`
boost'
My suspicion is that you have an older version on your hard drive whose headers are being picked up rather than those 1.31.0, try pre-processing the source, and filtering the result through less, you should then be able to work out what's going wrong,
John.
John, You were right. Fedora had already installed boost_1_30. I uninstalled the Fedora boost RPM's and reinstalled from the later tar ball version off boost.org and it all worked great. Many thanks Scott.
participants (2)
-
John Maddock
-
Scott Field