2011-01-11 5 views
1

이것은 C++ 응용 프로그램을 빌드하는 것을 처음으로 시도한 것이기 때문에 다소 잃어 버렸습니다. 몇 가지 예를 살펴 보았지만 여전히 잘못 알고 있습니다. C++에서 PCRE를 사용하는 데 도움이

#include <iostream> 
#include <stdio.h> 
#include <windows.h> 
#include <pcrecpp.h> 
#include <string> 
#include <cstring> 

using namespace std; 

int main() 
{ 
    char title[256]; 
    char url[256]; 
    string song, diff; 
    HWND hwnd = FindWindow("WindowsForms10.Window.8.app.0.33c0d9d", NULL); 
    GetWindowTextA(hwnd, title, 255); 
    pcrecpp::RE re("^osu! - (.*) \\[(.*)\\] \\[[|-]{21}\\]$"); 
    re.FullMatch(title, &song, &diff); 
    sprintf(url, "xfire:game_stats?game=%s&%s=%s&%s=%s", "osu", "Playing", song.c_str(), "Difficulty", diff.c_str()); 
    ShellExecute(NULL, NULL, url, NULL, NULL, SW_SHOWDEFAULT); 
    return 0; 
} 

내가 컴파일하려고

, 나는 다음과 같은 컴파일러 오류

obj\Debug\main.o||In function 'main':| C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|18|undefined reference to '_imp___ZN7pcrecpp2RE6no_argE'| C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|18|undefined reference to '_imp___ZN7pcrecpp2RE6no_argE'| C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|18|undefined reference to '_imp___ZN7pcrecpp2RE6no_argE'| C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|18|undefined reference to '_imp___ZN7pcrecpp2RE6no_argE'| C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|18|undefined reference to '_imp___ZN7pcrecpp2RE6no_argE'| obj\Debug\main.o:C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|18|more undefined references to '_imp___ZN7pcrecpp2RE6no_argE' follow| obj\Debug\main.o||In function 'main':| C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|18|undefined reference to '_imp___ZNK7pcrecpp2RE9FullMatchERKNS_11StringPieceERKNS_3ArgES6_S6_S6_S6_S6_S6_S6_S6_S6_S6_S6_S6_S6_S6_S6_'| C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|17|undefined reference to '_imp___ZN7pcrecpp2RED1Ev'| C:\Users\Zeffy\Desktop\osu-gamestats\main.cpp|17|undefined reference to '_imp___ZN7pcrecpp2RED1Ev'| obj\Debug\main.o||In function 'Arg':| C:\MinGW\msys\1.0\local\include\pcrecpparg.h|89|undefined reference to '_imp___ZN7pcrecpp3Arg12parse_stringEPKciPv'| obj\Debug\main.o||In function 'RE':| C:\MinGW\msys\1.0\local\include\pcrecpp.h|493|undefined reference to '_imp___ZN7pcrecpp2RE4InitERKSsPKNS_10RE_OptionsE'| ||=== Build finished: 11 errors, 0 warnings ===|

답변

5

_imp___ZN7pcrecpp2RE6no_argE가 변환 된 이름입니다 얻을. pcrecppno_arg 파트가 포함되어 있으므로 Pcrecpp에 연결하지 못하는 것이 문제라고 생각됩니다. 따라서 no_arg 기호가 정의되지 않았습니다.