首先下载并安装 Boost;
在CFree中编写代码如下;
#include <windows.h>
#include "resource.h"
#include <boost/regex.hpp>
//#include "C://local//boost_1_70_0//boost//regex.hpp"
using namespace std;
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
HINSTANCE hInst;
TCHAR szClassName[] = TEXT("boostDemo");
boost::regex exampleregex( "boost::regex" );
boost::cmatch result;
int WINAPI
WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
hInst = hThisInstance;
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_DBLCLKS;
本文介绍了在CFree中尝试使用Boost库,特别是正则表达式库regex的步骤,包括下载Boost,将库目录添加到CFree,拷贝lib和dll文件到工程目录。然而,在构建过程中遇到了链接错误,因为缺少`boost_regex-vc142-mt-x64-1_70.lib`对应的`.a`文件。因此,当前版本的CFree不完全支持Boost库的使用。
订阅专栏 解锁全文
2428

被折叠的 条评论
为什么被折叠?



