Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Boost Unit Test Problems

Boost Unit Test Problems

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
boost
5 Posts 2 Posters 1.7k Views
  • 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.
  • C Offline
    C Offline
    Conical
    wrote on 2 Mar 2020, 20:02 last edited by Conical 3 Feb 2020, 20:03
    #1

    Hi all. I'm new to Qt and also fairly new to Boost (especially on my personal devices). I'm trying to make a very simple Boost program just to see if I can get it to work, but I'm having some major problems just building it.

    I created a new project and added the following lines to the .pro file:

    INCLUDEPATH += C:\boost_1_68_0
    
    LIBS += C:\boost_1_68_0\boost\test\included\unit_test.hpp
    

    I also created the following test file:

    #include <main.h>
    #define BOOST_TEST_MODULE MyTest
    #include <boost/test/unit_test.hpp>
    
    BOOST_AUTO_TEST_CASE(MyTest)
    {
        BOOST_CHECK_EQUAL(makeInt(), 5);
    }
    

    The issues come from when the test file is being built. I repeatedly get the error:

    C:\boost_1_68_0\boost\test\included\unit_test.hpp:18: error: boost/test/impl/compiler_log_formatter.ipp: No such file or directory
     #include <boost/test/impl/compiler_log_formatter.ipp>
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    For some reason, the .ipp files that unit_test.hpp is including can't be found by it. I have verified that the files it is trying to find are in the location it is supposedly searching, but it just isn't getting them. I've tried messing with the INCLUDEPATH and LIBS but to no avail, and I've not found anyone else having this specific problem.

    I assume I'm missing something extremely simple, so does anyone know what's going wrong here?

    K 1 Reply Last reply 2 Mar 2020, 20:07
    0
    • C Conical
      2 Mar 2020, 20:02

      Hi all. I'm new to Qt and also fairly new to Boost (especially on my personal devices). I'm trying to make a very simple Boost program just to see if I can get it to work, but I'm having some major problems just building it.

      I created a new project and added the following lines to the .pro file:

      INCLUDEPATH += C:\boost_1_68_0
      
      LIBS += C:\boost_1_68_0\boost\test\included\unit_test.hpp
      

      I also created the following test file:

      #include <main.h>
      #define BOOST_TEST_MODULE MyTest
      #include <boost/test/unit_test.hpp>
      
      BOOST_AUTO_TEST_CASE(MyTest)
      {
          BOOST_CHECK_EQUAL(makeInt(), 5);
      }
      

      The issues come from when the test file is being built. I repeatedly get the error:

      C:\boost_1_68_0\boost\test\included\unit_test.hpp:18: error: boost/test/impl/compiler_log_formatter.ipp: No such file or directory
       #include <boost/test/impl/compiler_log_formatter.ipp>
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

      For some reason, the .ipp files that unit_test.hpp is including can't be found by it. I have verified that the files it is trying to find are in the location it is supposedly searching, but it just isn't getting them. I've tried messing with the INCLUDEPATH and LIBS but to no avail, and I've not found anyone else having this specific problem.

      I assume I'm missing something extremely simple, so does anyone know what's going wrong here?

      K Offline
      K Offline
      koahnig
      wrote on 2 Mar 2020, 20:07 last edited by
      #2

      @Conical

      Hi and welcome to devnet forum

      @Conical said in Boost Unit Test Problems:

      I created a new project and added the following lines to the .pro file:

      INCLUDEPATH += C:\boost_1_68_0
      
      LIBS += C:\boost_1_68_0\boost\test\included\unit_test.hpp
      

      Change the back slashes '\' to forward slashes '/' in the folder references.

      You need to use forward slashes alaso for windows. Back slashes have a special meaning and are used at end of line for continuation on next line.

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

      K C 2 Replies Last reply 2 Mar 2020, 20:11
      1
      • K koahnig
        2 Mar 2020, 20:07

        @Conical

        Hi and welcome to devnet forum

        @Conical said in Boost Unit Test Problems:

        I created a new project and added the following lines to the .pro file:

        INCLUDEPATH += C:\boost_1_68_0
        
        LIBS += C:\boost_1_68_0\boost\test\included\unit_test.hpp
        

        Change the back slashes '\' to forward slashes '/' in the folder references.

        You need to use forward slashes alaso for windows. Back slashes have a special meaning and are used at end of line for continuation on next line.

        K Offline
        K Offline
        koahnig
        wrote on 2 Mar 2020, 20:11 last edited by
        #3

        @koahnig

        Also LIBS parameter is for libraries created from object files e.g. *.lib

        unit_test.hpp is an include file which shall be already correctly included with INCLUDEPATH

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

        1 Reply Last reply
        1
        • K koahnig
          2 Mar 2020, 20:07

          @Conical

          Hi and welcome to devnet forum

          @Conical said in Boost Unit Test Problems:

          I created a new project and added the following lines to the .pro file:

          INCLUDEPATH += C:\boost_1_68_0
          
          LIBS += C:\boost_1_68_0\boost\test\included\unit_test.hpp
          

          Change the back slashes '\' to forward slashes '/' in the folder references.

          You need to use forward slashes alaso for windows. Back slashes have a special meaning and are used at end of line for continuation on next line.

          C Offline
          C Offline
          Conical
          wrote on 2 Mar 2020, 20:13 last edited by
          #4

          @koahnig said in Boost Unit Test Problems:

          Change the back slashes '' to forward slashes '/' in the folder references.

          Hi. I made these changes, but I'm still receiving the same build error I was before.

          Thank you for the advice, though.

          @koahnig said in Boost Unit Test Problems:

          unit_test.hpp is an include file which shall be already correctly included with INCLUDEPATH

          I removed the LIBS line, but all that did was break things even further, and caused several "undefined reference" errors in my tests file. Are you sure I don't need that line?

          K 1 Reply Last reply 2 Mar 2020, 20:26
          0
          • C Conical
            2 Mar 2020, 20:13

            @koahnig said in Boost Unit Test Problems:

            Change the back slashes '' to forward slashes '/' in the folder references.

            Hi. I made these changes, but I'm still receiving the same build error I was before.

            Thank you for the advice, though.

            @koahnig said in Boost Unit Test Problems:

            unit_test.hpp is an include file which shall be already correctly included with INCLUDEPATH

            I removed the LIBS line, but all that did was break things even further, and caused several "undefined reference" errors in my tests file. Are you sure I don't need that line?

            K Offline
            K Offline
            koahnig
            wrote on 2 Mar 2020, 20:26 last edited by
            #5

            @Conical

            The INCLUDEPATH seems to be correct. At least what you are showing.

            I do not know the test library feature of boost. However, I know that some features require separate compilation which will create libraries. This would be for the regular expression of boost for instance. Those libraries need to be referenced with LIBS statement.
            https://doc.qt.io/qt-5/qmake-variable-reference.html#libs

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

            1 Reply Last reply
            0

            2/5

            2 Mar 2020, 20:07

            • Login

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