Help precompiled boost library



  • Hi i am using one project open source with boost libraries but i must to include it. So i was searching i found one site with boost precompiled:
    http://www.npcglib.org/~stathis/blog/precompiled-boost/#comment-71476

    In my case i use vs2013 and qt 5.7. I must to include these libraries like always or i need to do something more? Bye and thx


  • Moderators

    @Jeronimo

    Did you ever had a look to the boost webpage?
    There are quite a number of different parts of boost or different boost libs. Some of them are simply template libraries which do not require precompilation respectively you cannot compile separately.

    Therefore, it would be good for you to check up-front, which part of the boost libs you need. Possibly you do not need any of those.
    If you require a section boost libs with compilable cpp-source file, then you can pick the correct one for your compiler and check, if the memory and all fits your needs.



  • @koahnig i need these:
    #include <boost/bind.hpp>
    #include <boost/algorithm/string.hpp>
    #include <boost/bind.hpp>
    #include <boost/function.hpp>
    #include <boost/random/discrete_distribution.hpp>
    #include <boost/random/exponential_distribution.hpp>
    #include <boost/random/mersenne_twister.hpp>
    #include <boost/random/random_number_generator.hpp>
    #include <boost/random/uniform_int_distribution.hpp>
    #include <boost/random/uniform_real_distribution.hpp>
    #include <boost/random/variate_generator.hpp>
    #include <boost/program_options.hpp>
    #include <boost/thread.hpp>



  • @koahnig I never took boost or nothing like this. I listened about can be installed with vs2013 anyways i couldn't ..


  • Lifetime Qt Champion

    Hi,

    What couldn't you ?



  • @SGaist Hi i cant use boost libraries with vs2013 i need to include them. I was trying with precompiled boost:
    http://www.npcglib.org/~stathis/blog/precompiled-boost/#comment-71476
    But anyways i dont know if i need to include the reference to these libraries. I'm little lost .


  • Lifetime Qt Champion

    What have you tried ?
    What error did you get ?



  • @SGaist i only included these libraries:
    #include <boost/bind.hpp>
    #include <boost/algorithm/string.hpp>
    #include <boost/bind.hpp>
    #include <boost/function.hpp>
    #include <boost/random/discrete_distribution.hpp>
    #include <boost/random/exponential_distribution.hpp>
    #include <boost/random/mersenne_twister.hpp>
    #include <boost/random/random_number_generator.hpp>
    #include <boost/random/uniform_int_distribution.hpp>
    #include <boost/random/uniform_real_distribution.hpp>
    #include <boost/random/variate_generator.hpp>
    #include <boost/program_options.hpp>
    #include <boost/thread.hpp>

    And trying to guess how to include the compiled library only tried that.


  • Lifetime Qt Champion

    Did you update your .pro file to add the path where the boost includes can be found to INCLUDEPATH ?
    Did you update your .pro file to add the path where the boost .lib files can found to LIBS ?
    Did you update your .pro file to add the boost libraries matching your include to link to ?



  • This post is deleted!

  • Lifetime Qt Champion

    Yes, you should add the base path to the include in INCLUDEPATH otherwise your includes won't work.

    You have "C:\Users\moh\Desktop\boost-1.60.0-x64-vs2013\boost64-1.60.0-vs2013\include\boost-1_60\boost\random", all your includes start with boost and not all your includes comes from boost/random. So remove these two folders from the path.



  • @SGaist I tried with boost but i think the library i need to include other?
    i tried this:
    LIBS += -boost_random-vc120-mt-gd-1_60 -LC:/Users/moh/Desktop/boost-1.60.0-x64-vs2013/boost64-1.60.0-vs2013/lib
    INCLUDEPATH += "C:\Users\moh\Desktop\boost-1.60.0-x64-vs2013\boost64-1.60.0-vs2013\include\boost-1_60\boost"

    Sorry again a lot!


  • Lifetime Qt Champion

    Again, all your includes start with boost so that folder must not appear in your INCLUDEPATH statement.



  • @SGaist Ok sorry you are right the issue solved. But one details about the project that i use boost:
    Ok i included libraries boost but now i am trying to run one easy example but when i try i get this message:
    C:\Users\moh\Documents\intento\scheduler.cpp:-1: error: C1041: no puede abrir la base de datos de programa 'c:\users\moh\documents\build-intento-qt_5_7_0_msvc2013_static-debug\debug\intento.pdb'. Si varios CL.EXE escriben en el mismo archivo .PDB, use /FS.

    You know about this or can me take some advice?


  • Lifetime Qt Champion

    With the text in english it will be easier to help.



  • @SGaist Ok the text is:
    C:\Users\moh\Documents\intento\scheduler.cpp:-1: error: C1041: can't open the data bases of the program 'c:\users\moh\documents\build-intento-qt_5_7_0_msvc2013_static-debug\debug\intento.pdb'. If several cl.exe write in the same file .PDB, use /FS



  • @SGaist And when i try to compile with vs2013 i get this:
    i put nmake
    and show me:
    cl .\main.cpp .\scheduler.cpp

    cl : Línea de comandos warning D9002 : se omite la opción desconocida '-std=c++11'
    main.cpp
    c:\users\moh\documents\intento\scheduler.h(5) : fatal error C1014: hay demasiados archivos de inclusión : nivel = 1024
    scheduler.cpp
    c:\users\moh\documents\intento\scheduler.h(5) : fatal error C1014: hay demasiados archivos de inclusión : nivel = 1024
    Generando código...
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : código devuelto '0x2'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : código devuelto '0x2'
    Stop.




  • Lifetime Qt Champion

    Are you trying to build that project with a static self-built Qt ?



  • @SGaist yes static built. I use static and show me this: C:\Users\moh\Documents\intento\main.cpp:-1: error: C1041: no puede abrir la base de datos de programa 'c:\users\moh\documents\build-intento-qt_5_7_0_msvc2013_static-debug\debug\intento.pdb'. Si varios CL.EXE escriben en el mismo archivo .PDB, use /FS. But i think maybe is other reason not build? some suggestion?


  • Lifetime Qt Champion

    Before trying to build a project with a static version of Qt, build it with the standard dynamic version.

    Note that the -std=c++11 is not an option for VS.



  • @SGaist i used this and the first error doesnt appear:
    QMAKE_CXXFLAGS += /FS

    But now show me still show me the last:
    C:\Users\moh\Desktop\boost-1.60.0-x64-vs2013\boost64-1.60.0-vs2013\include\boost-1_60\boost\type_traits\common_type.hpp:42: error: C1001: Error internal in the compiler

    And when i click this is the part alert me:

    namespace type_traits_detail
    {

    template<class T1, class T2, class... T> using common_type_fold = common_type_t<common_type_t<T1, T2>, T...>; //here

    }


  • Lifetime Qt Champion

    That's noting Qt related, the compiler crashed on boost.

    You should upgrade to VS2015 or try MinGW.



  • This post is deleted!

Log in to reply
 

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