Вопрос

I'm trying to statically link to the boost regex library. I'm using the latest version of boost (1.54) and I can't seem to get it to work. I tried compiling the libraries by first running bootstrap.sh, and then b2 link=static.

When compiling my program, I am using the compiler flags -I/path/to/boost, and I add /path/to/boost/lib/libboost_regex.a as one of my linker objects. Making calls to boost::regex methods don't work as expected, such as boost::regex_search.

I have confirmed that my code works as expected when I link to the boost library dynamically. Is there some sort of initialization that needs to be performed when linking statically?

Это было полезно?

Решение

I must have been doing something wrong. Adding libboost_regex.a to my list of linker objects seems to work fine.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top