C++中使用PCRE的帮助 这是我第一次尝试构建C++应用程序,所以我有点迷路了。我已经看了一些例子,但我仍然不知道到底出了什么问题 #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; }

C++中使用PCRE的帮助 这是我第一次尝试构建C++应用程序,所以我有点迷路了。我已经看了一些例子,但我仍然不知道到底出了什么问题 #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; },c++,windows,g++,pcre,codeblocks,C++,Windows,G++,Pcre,Codeblocks,当我试图编译时,我得到以下编译器错误 函数“main”中的obj\Debug\main.o | |:| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |未定义对“_imp__ZN7pcrecpp2RE6no_argE”的引用| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |未定义对“_imp__ZN7pcrecpp2RE6no_argE”的引用| C:\Users\Zeffy\Des

当我试图编译时,我得到以下编译器错误

函数“main”中的obj\Debug\main.o | |:| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |未定义对“_imp__ZN7pcrecpp2RE6no_argE”的引用| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |未定义对“_imp__ZN7pcrecpp2RE6no_argE”的引用| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |未定义对“_imp__ZN7pcrecpp2RE6no_argE”的引用| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |未定义对“_imp__ZN7pcrecpp2RE6no_argE”的引用| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |未定义对“_imp__ZN7pcrecpp2RE6no_argE”的引用| obj\Debug\main.o:C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |以下是对“_imp_uuuuzn7pcrecpp2re6no_argE”的更多未定义引用| 函数“main”中的obj\Debug\main.o | |:| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 18 |未定义对“_imp_uuuuuuuuuuuznk7pcrecpp2re9fullmatcherkns_11stringpiecerkns_3ArgES6_S6_S6_S6_S6_S6_S6_S6_6_6_6_6_6_6_6_6_6_6_6_6_6_6_6_6_| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 17 |未定义对“_imp__ZN7pcrecpp2RED1Ev”的引用| C:\Users\Zeffy\Desktop\osu gamestats\main.cpp | 17 |未定义对“_imp__ZN7pcrecpp2RED1Ev”的引用| 函数“Arg”中的obj\Debug\main.o | |:| C:\MinGW\msys\1.0\local\include\pcrecpparg.h | 89 |未定义对“_imp_uuuuuzn7pcrecpp3arg12parse_stringEPKciPv”的引用| 函数“RE”中的obj\Debug\main.o | |:| C:\MinGW\msys\1.0\local\include\pcrecpp.h | 493 |未定义对“_imp_|u ZN7pcrecpp2RE4InitERKSsPKNS_10RE|选项”的引用| ||===构建完成:11个错误,0个警告==

导入ZN7pcrecpp2RE6no\argE是一个损坏的名称。由于它包含pcrecpp和no_arg部分,我怀疑问题在于您未能链接到pcrecpp。因此,没有定义no_arg符号。

\u imp___ZN7pcrecpp2RE6no_argE是一个损坏的名称。由于它包含pcrecpp和no_arg部分,我怀疑问题在于您未能链接到pcrecpp。因此,没有定义no_arg符号