Visual C++ 6.0下使用BoostRegex

來源:互聯網
上載者:User
最近開始看《精通Regex(第3版)》,裡面提到了C/C++也有自己的Regex,但是該書介紹了Perl、Java、.NET、PHP……等語言的Regex的用法,唯獨沒有講述C/C++語言中的Regex,於是去網上搜尋了下,找到一個開源的C/C++Regex庫——Boost。
參照文章: VC6.0下配置Boost庫使用Regex
進行一些配置,也寫了測試案例,通過編譯。
可能會遇到的問題:
1、
Regex_test.cpp
d:"boostl"boost"regex"v4"perl_matcher_common.hpp(767) : fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1794)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Command line warning D4028 : minimal rebuild failure, reverting to normal build
Error executing cl.exe.
Regex_test.exe - 1 error(s), 1 warning(s)

是因為你修改了程式,直接按“Ctrl+ F5”運行程式,
修正方法:重新Rebuild下就OK了
2、
Compiling...
Regex_test.cpp
Linking...
LINK : fatal error LNK1104: cannot open file "libboost_regex-vc6-sgd-1_34_1.lib"
Error executing link.exe.
Regex_test.exe - 1 error(s), 0 warning(s)

可能是是標頭檔的緣故
libboost_regex-vc6-sgd-1_34.lib中“libboost_regex-vc6-sgd-1_34”的後面加“_1”即可
其他的方法的庫也應該也有這方面的問題。

由文章中講述的配置過程,可以適用於VC++ 7.1(Visual Studio .NET 2003)以及VC++ 8.0(Visual Studio 2005)。
by 夢書

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.