Use Greta(STL) in MFC.

From: msg_du (dch1237_at_msn.com)
Date: 12/12/04


Date: Sun, 12 Dec 2004 23:52:36 +0800

I create a MFC project and use Greta which is a STL as following:

#include <iostream>

#include <windows.h>
#include <tchar.h>

#include "regexpr2.h"

using namespace std;
using namespace regex;

void CMyDlg::OnButton1()
{
    match_results res;
    _TCHAR * ptz = _T("string test");
    rpattern pat(_T("[^\\s]+"));

    match_results::backref_type br = pat.match(ptz, res);
    if (br.matched) {
        cout << "success: " << br << endl;
    } else {
        cout << "fail" << endl;
    }

}

But always fail during compiling :

--------------------Configuration: try_8 - Win32 Debug--------------------
Compiling resources...
Compiling...
dch_try_8Dlg.cpp
regexpr2.cpp

f:\microsoft visual studio\myprojects\try_8\regexpr2.cpp(59) : warning
C4005: 'REGEXPR_H_INLINE' : macro redefinition

        f:\microsoft visual studio\myprojects\try_8\regexpr2.cpp(57) : see
previous definition of 'REGEXPR_H_INLINE'

f:\microsoft visual studio\myprojects\try_8\regexpr2.cpp(64) : error C2006:
#include expected a filename, found 'identifier'

f:\microsoft visual studio\myprojects\try_8\regexpr2.cpp(64) : fatal error
C1903: unable to recover from previous error(s); stopping compilation
syntax2.cpp

f:\microsoft visual studio\myprojects\try_8\syntax2.cpp(241) : fatal error
C1010: unexpected end of file while looking for precompiled header directive

Generating Code...
Skipping... (no relevant changes detected)
dch_try_8.cpp
Error executing cl.exe.

dch_try_8.exe - 3 error(s), 1 warning(s)