Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Help to use Boost libraries in QtCreator on Windows 7
Forum Updated to NodeBB v4.3 + New Features

Help to use Boost libraries in QtCreator on Windows 7

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thibault44
    wrote on last edited by
    #1

    Hi everyone,
    I have Qt Creator installed on Windows 7 and I have download and build Boost 1.62, so in C:\Boost I think that I have all the files I need to use Boost libraries. But now, I want to create a little graphical messaging service using Qt and Boost.Asio. But I'm a begginer and even if I have basically understood the different stages of compilation, I have some difficulties to correctly configure Qt tu use Boost. A priori, I need to write something in the .pro file of my project but I don't understand very well what I need to put in this file, so if someone could help me, it would be very nice :)
    Thibault.

    K 1 Reply Last reply
    0
    • T Thibault44

      Hi everyone,
      I have Qt Creator installed on Windows 7 and I have download and build Boost 1.62, so in C:\Boost I think that I have all the files I need to use Boost libraries. But now, I want to create a little graphical messaging service using Qt and Boost.Asio. But I'm a begginer and even if I have basically understood the different stages of compilation, I have some difficulties to correctly configure Qt tu use Boost. A priori, I need to write something in the .pro file of my project but I don't understand very well what I need to put in this file, so if someone could help me, it would be very nice :)
      Thibault.

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Thibault44

      Hi and welcome to devnet forum

      Boost has different parts.
      Some parts are simply based on templates which are all in include files. There you to make sure that the boost folder is included in the
      INCLUDEPATH of your project.

      Other parts require a separate compilation and creation of a library. I am not sure about ASIO, but I guess you need to compile. For this you need to follow the instrcution given with boost and use the same compiler as you plan to use with Qt.

      However, are you sure that you need ASIO?
      There might be the same functionality available in Qt.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      2
      • T Offline
        T Offline
        Thibault44
        wrote on last edited by Thibault44
        #3

        Hi, thank you for your reply,
        I have already put INCLUDEPATH += C:\Boost in my .pro file, and yes, Asio require a separate compilation and the creation of a library.
        I have already done it but for MinGW, I choose this one because Qt is using cmake so I thought that MinGW was the right choice. Do I need to rebuild Boost for another compiler or is MinGW ok ?
        In the Boost's documentation, there is no instruction for the Qt Creator configuration but I think that I need to put something in my .pro file related to the linker, no ?
        And yes there are probably the same functionnalities in Qt but maybe I will also use other Boost libraries (if I manage to use it) like Boost.Regex or Boost.FileSystem.

        K 1 Reply Last reply
        0
        • T Thibault44

          Hi, thank you for your reply,
          I have already put INCLUDEPATH += C:\Boost in my .pro file, and yes, Asio require a separate compilation and the creation of a library.
          I have already done it but for MinGW, I choose this one because Qt is using cmake so I thought that MinGW was the right choice. Do I need to rebuild Boost for another compiler or is MinGW ok ?
          In the Boost's documentation, there is no instruction for the Qt Creator configuration but I think that I need to put something in my .pro file related to the linker, no ?
          And yes there are probably the same functionnalities in Qt but maybe I will also use other Boost libraries (if I manage to use it) like Boost.Regex or Boost.FileSystem.

          K Offline
          K Offline
          koahnig
          wrote on last edited by koahnig
          #4

          @Thibault44

          You need to add

          INCLUDEPATH += C:/Boost
          

          In general you make your life easier when using the forward slash with Qt files. The backward slash is used in most Qt based stuff for continuation lines.

          I would recommend to compile boost libs with the very same MinGW compiler as it is used for Qt prebuild. It is not always clear if the different compiler versions are fully compatible.

          ASIO is serial and network I/O to my understanding. This is provided also by Qt. The same is for RegEx and FileSystem.

          Personally I have thrown out my use of boost regex and switched to Qt's implementation because of the required recompilation of libs for boost. However, I am using boost smart pointers and others which rely only on includes.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          2
          • T Offline
            T Offline
            Thibault44
            wrote on last edited by
            #5

            @koahnig
            Ok thank you, I will try !

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved