rsk82
rsk82

Reputation: 29407

how to properly link boost regex?

This code compiles ok:

#include <boost\regex.hpp>
int main() {
  boost::regex reg("[a-z]+");
}

But where it comes to linking there is error message:

d:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status

What option in commandline must I put ? my current switches are:

-I "d:\mingw\include" -I "d:\boost" -Os -s -o "test.exe" "test.cpp" -std=c++11 -ftree-vectorize -static

Upvotes: 0

Views: 1265

Answers (1)

Anton Kovalenko
Anton Kovalenko

Reputation: 21517

Try adding -lboost_regex or -lboost_regex-mt

Upvotes: 4

Related Questions