March 5, 2012

mzimmers mzimmers
Lab Rat
529 posts

Creator not “seeing” path to boost library

 

I’m once again preparing to dabble with boost (need a circular buffer). I installed it into C:\Program Files\boost_1_49_0. The directory “boost” lives in there. I added this to my PATH environment variable, and it appears in the build environment, but…in the editor, I still get no such file or directory. Any ideas what I might have screwed up now?

13 replies

March 5, 2012

mlong mlong
Robot Herder
1551 posts

You’ll need to add the path and library to the LIBS variable in your .pro file, and make sure that any boost headers are pointed to by the INCLUDEPATH variable.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

March 5, 2012

mzimmers mzimmers
Lab Rat
529 posts

OK…I’m about to show how little I know about boost with this question. I thought you could use only the include files if you wanted. I haven’t built the libraries. Am I misinformed?

And, so the .pro file would contain lines like:

  1. LIBS += C:\Program Files\boost_1_49_0\libs
  2. INCLUDEPATH += C:\Program Files\boost_1_49_0

since the boost subdirectory is under the boost_1_49_0 directory, and I include “/boost” in my #include statements, I assume that’s adequate.

So…how many mistakes have I made here?

EDIT:

Oh, I see one already: this needs to work on multiple platforms (Mac OS X and Windows 7 64-bit). I know I need to do something like this:

  1. win32:INCLUDEPATH += "C:/mylibs/extra headers"
  2.  unix:INCLUDEPATH += "/home/user/extra headers"

(this is an example from the docs)

My question is, where do the values for the prefix (like “win32” and “unix”) get defined? I’ll need to know that one exists for my (64-bit) platform.

March 5, 2012

mlong mlong
Robot Herder
1551 posts

I’m no expert in Boost, but I would assume that if there are libraries, they would have to be built. Typically, header files only have class definitions, and C++ files have the implementations which are compiled into libraries.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

March 5, 2012

Andre Andre
Robot Herder
6417 posts

Note that there is also a MR (by ZapB) for a QCircularBuffer. You might want to look into using that, as it sports the familiar Qt container API.

March 5, 2012

mzimmers mzimmers
Lab Rat
529 posts

An “MR?”

And I just may use that instead, but…I’m getting pretty tired of not being able to finish things. I am going to get boost installed properly, come hell or high water.

March 5, 2012

Andre Andre
Robot Herder
6417 posts

Sorry, a Merge Request, a request to add or modify a piece of code in Qt itself. You can find the suggestion and the code here: http://gitorious.org/~seanharmer/qt/seanharmers-qtdoc

Good luck with getting Boost to run! What parts of Boost are you trying to get running? Most of Boost does not need to be build; many parts are templated, header only. All you need to do is make sure qmake can find the include locations.

March 5, 2012

mzimmers mzimmers
Lab Rat
529 posts

Well, that’s what I’m working on right now. I have to fool with some qmake variables. The documentation is a bit sparse in that area.

March 5, 2012

Andre Andre
Robot Herder
6417 posts

You are looking for INCLUDEPATH += path/to/boost

March 5, 2012

mzimmers mzimmers
Lab Rat
529 posts

Yeah, just to test, I put an unconditional INCLUDEPATH in the .pro file on my Windows machine, and Creator finds boost now (at least the .hpp files, which is good enough for me at present).

Now, for making this platform-independent, where can I find a list of the prefixes like “win32” and “unix”? I assume those are pre-set, since there are no definitions of them in my .pro file.

Thanks.

March 5, 2012

Andre Andre
Robot Herder
6417 posts

You expect that you can always find the library in the same place, depending only on the platform? That’s rather… optimistic. There is no such standard path that I am aware of.

March 5, 2012

mzimmers mzimmers
Lab Rat
529 posts

No, I don’t expect that — I expect just the opposite…that’s why I realize the need for using those prefixes. My question is, where can I find a list of those prefixes? I want to make sure I’m choosing the right one for my Windows 7 64-bit version. Plus, I’d like to look them over.

March 5, 2012

Andre Andre
Robot Herder
6417 posts

I’m afraid I don’t understand what prefixes you mean then, sorry.

March 5, 2012

mzimmers mzimmers
Lab Rat
529 posts

I may be calling them the wrong thing, but the “win32:” and “unix:” tokens at the start of lines like this:

  1. win32:INCLUDEPATH += "C:/mylibs/extra headers"
  2.  unix:INCLUDEPATH += "/home/user/extra headers"

 
  ‹‹ Debugger not attaching quickly enough?      Search and replace across source and ui files ››

You must log in to post a reply. Not a member yet? Register here!