Including relevant acceleration libraries with C ++ source (using Visual Studio)

I have a project I'm working on (for school) that I am sorting through the Boost libraries for solutions. I need to somehow distribute the required Boost source code with my application so that it can be compiled without installing libraries in the compilation system. (School computers have almost nothing to say. The school just installed CVS last year, but they have VS2005)

Note. I am using Visual Studio 2005 for Vista. I have Boost 1.34.1 on my system, I used the automatic installer . The documentation I came across says something about using the BCP command, but this command does not copy anything. (I use the absolute path to call BCP, so I am not calling the wrong command.)

Edit: I am trying to use RegEx libraries.

Edit: the command I use for BCP is: "c:\Program Files\boost\boost_1_34_1\bin\bcp.exe" boost/regex.hpp regex\

And it returns: no errors detected

+5
c ++ boost visual-studio
source share
6 answers

It depends on the library used. If you use the library for headers only (most boost libraries, some notable exceptions are signals, serialization, and date / time), you can simply copy these header files. Otherwise, you will also have to copy the cpp files. My suggestion is to simply include them in your project.

So here is what you do: you remove the boost enable path from your project settings (tool-> options-> projects and solutions-> vC ++ directories-> include files). Try compiling. See what it refers to. Copy this file from the boost directory to the project directory. Pour, rinse, repeat until your project compiles.

If you use a library that requires .cpp files, you will receive an error message during the connection. Copy all the .cpp files of the library that you are using into the project directory and add all of them to your solution. Rearrange and cross your fingers.

For a more detailed answer, indicate which libraries you use.

+5
source share

Try calling bcp with this command:

 "c:\Program Files\boost\boost_1_34_1\bin\bcp.exe" --boost="c:\Program Files\boost\boost_1_34_1" regex regex 

--boost tells bcp where boost is installed, the first regex is the name of the modules, the second is the destination directory.

Oh, and if you havenโ€™t noticed yet, in Visual C ++ there are make files in libs\regex\build\ .

+2
source share

Based on your comment that you are using regex, here's what you do: upload a โ€œnormalโ€ zip file with the extension. Unzip it somewhere. Go to libs / regex / src. Copy and paste all the .cpp files in this directory into the project directory. Add them to your Visual Studio project (right-click, "add" โ†’ "existing item"). Then go to boost / regex and copy everything there (header files) into the project directory (including subdirectories). Change all the C # include files included in your .cpp and .h to "regex.hpp" so that they include the headers from your local directory, and not the ones that were installed at the system scale. Be sure to remove the system-wide path from the project settings, as I said in my last post.

Then compile your code. You will get some โ€œmissing include fileโ€ errors because the regular expression depends on other boost libraries. Repeat the whole process: go to boost / xxx, where xxx is the library the regular expression is looking for. You can get the library out of the error message. Copy everything that the compiler asks for from your own project directory. You may need to play a little with the layout of your catalog. This is a step-by-step approach where each step is the same: identify the missing file, copy it, see if it is found and fixed, and continue from the next step. This is a boring job that I'm afraid of.

You can automate all this with bcp, but for a one-time project, such as a school project, I would not bother; only if you think that you will have future projects that require you to provide an offline zip file.

+2
source share

It seems a little strange to me. If you distribute the source code, then the people you distribute should be able to install boost. Then, if they already have an impulse, there is no duplication and confusion, or if they do not, and you need a built-in library, they will build the right library for their system. If the people you distribute are not able to install boost, then I would suggest distributing the binaries in the installation package to make them as easy as possible for them.

+1
source share

I have already come across this before, implementing a promotion in my projects. Each separate acceleration library comes with different project files to create with different make systems (Jam, make, Visual Studio 6 ...), but they are never so good in newer versions of VS.

I always prefer to create a new project file and embed boost directly in my project. It is quite simple, you just need to add all the source files and configure the project settings correctly. However, there is one caveat, and you should specify the library output file, as boost does, because their included files depend on it.

Once you do this, you can distribute boost libraries in the same way as any other files in your project.

0
source share

This is such a PITA to compile boost; only motivated students can do this. Have you considered installing the installer?

0
source share

All Articles