BCB 2006 "F1004 Internal compiler error ..." when using Regex library

I'm working with the Regex library and I get the following compiler error: [C++ Fatal Error] regex_replace.hpp(95): F1004 Internal compiler error at 0x99a2402 with base 0x9930000 When I uncomment the line (last function in mydll.cpp): //std::wstring txt = L""; I find this very strange since this line of code doesn't seem to have anything to do with the error I'm getting. I found discussions about similar errors in the archive but nothing that helped me solve my problem. Does anyone know how to solve this? I'm working with Borland C++ Builder 2006. Thanks, Alain //----------------------------------------------------- //mydll.cpp // ... #define BOOST_ALL_NO_LIB #include "boost/regex.hpp" #pragma argsused int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved) { return 1; } std::wstring ibs_wregex_replace(std::wstring s, std::wstring rx, std::wstring replace) { boost::wregex reg(rx); return boost::regex_replace(s, reg, replace); } std::string ibs_regex_replace(std::string s, std::string rx, std::string replace) { boost::regex reg(rx); return boost::regex_replace(s, reg, replace); } std::wstring f(std::wstring& xml_str, std::wstring e) { // **** COMPILER ERROR WHEN I UNCOMMENT THE NEXT LINE **** //std::wstring txt = L""; return L""; } // ... //---------------------------------------------------- //regex_replace.hpp // ... template <class traits, class charT> std::basic_string<charT> regex_replace(const std::basic_string<charT>& s, const basic_regex<charT, traits>& e, const std::basic_string<charT>& fmt, match_flag_type flags = match_default) { std::basic_string<charT> result; // **** THE NEXT LINE NUMBER IS 95 **** re_detail::string_out_iterator<std::basic_string<charT> > i(result); // **** line 95 **** regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags); return result; } // ...

Alain Cormier wrote:
I found discussions about similar errors in the archive but nothing that helped me solve my problem.
Does anyone know how to solve this?
I'm working with Borland C++ Builder 2006.
All I can say is I've seen that with C++ Builder and all kinds of code. Sometimes it only happens when compiling from the IDE, sometimes only from the command line. All I can suggest is that you try and simplify the code and split it between multiple source files. John.
participants (2)
-
Alain Cormier
-
John Maddock