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?


  • Moderators

    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.



  • 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:

    @LIBS += C:\Program Files\boost_1_49_0\libs
    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:

    @win32:INCLUDEPATH += "C:/mylibs/extra headers"
    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.


  • Moderators

    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.



  • 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.



  • 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.



  • 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.



  • 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.



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



  • 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.



  • 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.



  • 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.



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



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

    @win32:INCLUDEPATH += "C:/mylibs/extra headers"
    unix:INCLUDEPATH += "/home/user/extra headers"@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.