2009-10-24 4 views
1

처음으로 GCC로 전환하면 컴파일러에서 내게 말하는 내용에 다소 혼란스러워집니다. 본질적으로, 그것은 boost :: xpressive :: wsregex가 정의되지 않은 것처럼 행동합니다 (저는 믿습니다). 여기 Boost :: Xpressive MinGW에서 퍼즐 컴파일

는 관련 코드 :

#include "criterion.h" 
#include <string> 
#include <boost/xpressive/xpressive.hpp> 

//More lines of code omitted here 

class perlRegex : public regexClass 
{ 
private: 
    std::wstring regexString; 
    boost::xpressive::wsregex regex; // This is the line complained about 
public: 
    unsigned __int32 getPriorityClass() const; 
    BOOL include(fileData &file) const; 
    unsigned int directoryCheck(const std::wstring& /*directory*/) const; 
    std::wstring debugTree() const; 
    perlRegex(const std::wstring& inRegex); 
}; 

그리고 여기에 오류가 :

regex.h:46: error: using-declaration for non-member at class scope 
regex.h:46: error: expected `;' before "regex" 

은 내가 여기에 대해 혼란 스러워요 것은 내가 멤버를 선언하고있어 것입니다, 그러나 그것은 불평 나는 다른 곳에서 회원을 사용하고 있습니다.

#include을 잊어 버렸습니까? 사전에

감사합니다, Billy3

+0

내가 regexClass의 정의가 criterion.h 또는 생략 앞의 코드에 하나있을 것 같은데요? –

+0

예, criterion.h에'#define'd가 있습니다. –

+0

헤더 검색 경로가 올바른지, 즉 부스트 라이브러리가 소스에 제대로 포함되어 있는지 확인할 수 있습니까? – dirkgently

답변

5

Cygwin에서와와 Mingw 넓은 문자를 지원하지 않기 때문에 xpressive 중 하나를 할 수 없습니다. xpressive_fwd.hpp에서 다음을 참조하십시오

#if defined(BOOST_NO_CWCHAR) | \ 
    defined(BOOST_NO_CWCTYPE) | \ 
    defined(BOOST_NO_STD_WSTRING) 
# ifndef BOOST_XPRESSIVE_NO_WREGEX 
# define BOOST_XPRESSIVE_NO_WREGEX 
# endif 
#endif 

매크로 BOOST_NO_CWCHAR, BOOST_NO_CWCTYPE 및 BOOST_NO_STD_WSTRING이 당신의 platcorm/컴파일러/표준 라이브러리에 대한 부스트의 config.hpp 헤더에 의해 자동으로 정의됩니다. 죄송합니다.

앞으로는 부스트 사용자의 목록에 부스트 질문을 올리는 것이 더 좋은 결과를 얻게 될 것입니다.

- 에릭 Niebler BoostPro 컴퓨팅 www.boostpro.com

+0

내가 마이크로 소프트의 컴파일러에 붙어있는 것 같아요. ( –

+2

와우! 매일 라이브러리 작성자의 답변을 얻지 못했습니다. 다시 한번 감사드립니다 :) –