2016-09-15 5 views
1

Nick Gammon's Regexp library을 사용하는 동안이 오류가 발생합니다. 이 오류는 다음과 같습니다 :Arduino IDE에서 regex 용 라이브러리를 사용하는 동안 'longjmp'에 대한 정의되지 않은 참조

 
libraries/Regexp/Regexp.cpp.o:(.text._ZL5errorc+0x4): undefined reference to `longjmp' 
libraries/Regexp/Regexp.cpp.o: In function `error': 
/Users/jaiprak/projects/Arduino/libraries/Regexp/Regexp.cpp:640: undefined reference to `longjmp' 
libraries/Regexp/Regexp.cpp.o: In function `max_expand': 
/Users/jaiprak/projects/Arduino/libraries/Regexp/Regexp.cpp:640: undefined reference to `setjmp' 
libraries/Regexp/Regexp.cpp.o: In function `MatchState::Match(char const*, unsigned int)': 
/Users/jaiprak/projects/Arduino/libraries/Regexp/Regexp.cpp:640: undefined reference to `setjmp' 
collect2: error: ld returned 1 exit status 
exit status 1 
Error compiling for board Generic ESP8266 Module. 

을 그리고 이것은 내 아두 이노 코드 :

#include <Regexp.h> 

// called for each match 
void match_callback (const char * match,   // matching string (not null-terminated) 
        const unsigned int length, // length of matching string 
        const MatchState & ms)  // MatchState in use (to get captures) 
{ 
    char cap [10]; // must be large enough to hold captures 

    Serial.print ("Matched: "); 
    Serial.write ((byte *) match, length); 
    Serial.println(); 

    for (byte i = 0; i < ms.level; i++) 
    { 
     Serial.print ("Capture "); 
     Serial.print (i, DEC); 
     Serial.print (" = "); 
     ms.GetCapture (cap, i); 
     Serial.println (cap); 
    } // end of for each capture 

} // end of match_callback 


void setup() 
{ 
     Serial.begin (115200); 
     Serial.println(); 
     unsigned long count; 

     // what we are searching (the target) 
     char buf [100] = "The quick brown fox jumps over the lazy wolf"; 

     // match state object 
     MatchState ms (buf); 

     // original buffer 
     Serial.println (buf); 

     // search for three letters followed by a space (two captures) 
     count = ms.GlobalMatch ("(%a+)()", match_callback); 

     // show results 
     Serial.print ("Found "); 
     Serial.print (count);   // 8 in this case 
     Serial.println (" matches."); 


} // end of setup 

void loop() {} 

답변

0

setjmplongjumpESP8266 core for Arduino에서 사용하지 않는 libc의의 normaly 일부입니다.

이 문제는 #910에 설명되어 있습니다. 의견은 이것이 달성 될 수있는 방법을 나타내지 않고 libc_replacements.c에 구현할 것을 제안합니다.