Sign in to follow this  
Endar

boost::regex

Recommended Posts

I didn't build all the boost libraries because I find it easier (although the compile times are longer) to just include the header files of what I need from the boost libraries. Am I right in thinking that the regex library is an actual library and I need to compile it as such to use the boost regular expression parsing?

Share this post


Link to post
Share on other sites
Regex needs some object files. You can either use bjam, or add the files directily to your project, though the latter approach may take some massaging of the config files.

Share this post


Link to post
Share on other sites
I thought that I would get an actual library to use, since VC++ 2005 express keeps complaining that it can't open "libboost_regex-vc80-mt-sgd-1_33_1.lib".

After much compiling by boost jam, I have a whole lot of object files and lib files for a whole bunch of stuff. Except for regex.

Am I able to just link to the object files? Or do I have to compile the regex object files to a library somehow?

Share this post


Link to post
Share on other sites
Its a shame that nobody seems able to help you. If only the boost comunity provided some means to get help directly from people that specialize in boost issues...perhaps some sort of list where one could mail questions.

CM

Share this post


Link to post
Share on other sites
Quote:
Original post by Conner McCloud
Its a shame that nobody seems able to help you. If only the boost comunity provided some means to get help directly from people that specialize in boost issues...perhaps some sort of list where one could mail questions.

CM

I think you are hinting to the OP that he try the boost mailing lists...but I can't tell from the text. Here are the relevant links:

http version
news version

Share this post


Link to post
Share on other sites
Just a few points about boost and linking in general.

1. When you start using a new library, or even a new part of a library you are familiar with, review the instructions: http://www.boost.org/more/getting_started.html contains all of the answers to your question and more. Don't forget to pay special attention to the instructions relating to your configuration (platform and compiler) http://www.boost.org/tools/build/v1/vc-8_0-tools.html

2. If you've followed the instructions on the boost webpage, then it's possible that your project or IDE settings aren't configured correctly (do they point to the boost include and library directories?)

Boost, like all c/c++ libraries either need to be linked to or they don't - there is no maybe or optional linking. The only time you don't need to link a library in is when the library is header only. Large parts of boost fall into this category. Don't fall into the trap of thinking boost is 'one big library'.

Don't forget that if you do need to link to a library, you will need to modify your build system to do this. The only exception to this is when linking is specified implicitly in the source - for example with compiler specific pragmas. Most boost libraries (including boost::regex) which can be linked to fall into this category, but AFAIK only with the Microsoft compilers.



Share this post


Link to post
Share on other sites
Okay, looks like I got it working.

The things I did differently to last time? I ran bjam with the option "stage" so it would make things easier and copy all the libs to a single directory. Also, I found that I hadn't set up vsvars32.bat for the platform sdk.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this