CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2008
    Posts
    902

    Building Boost for Mingw

    I was hoping somebody could help me, because I'm having a heck of a time. I've recently become more involved with cross-platform programming, so I have switch from MSVC to Mingw so I can use the same compiler in Windows as I do Linux (gcc 4.5.2).

    My problem is that Mingw doesn't search for includes and libs in the right directories by default. I either have to use an IDE or manually specify with -IC:\MinGW\include\ flags from the command line. However, when I try to execute bjam, there is no way to tell it where to search for these files (that I know of) so bjam fails to compile anything.

    Help would be appreciated.

  2. #2
    Join Date
    May 2009
    Posts
    2,413

    Re: Building Boost for Mingw

    Quote Originally Posted by Chris_F View Post
    Help would be appreciated.
    Maybe you don't have to build Boost. Most libraries are headers only.

  3. #3
    Join Date
    Aug 2008
    Posts
    902

    Re: Building Boost for Mingw

    Quote Originally Posted by nuzzle View Post
    Maybe you don't have to build Boost. Most libraries are headers only.
    I'm mostly interested in boost::thread.

  4. #4
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Building Boost for Mingw

    Quote Originally Posted by Chris_F
    My problem is that Mingw doesn't search for includes and libs in the right directories by default. I either have to use an IDE or manually specify with -IC:\MinGW\include\ flags from the command line.
    That's weird. I mean, yes, you have to specify include directories if they are not in the compiler's include directory, but if they are, it should be found by default.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  5. #5
    Join Date
    May 2009
    Posts
    2,413

    Re: Building Boost for Mingw

    Quote Originally Posted by Chris_F View Post
    I'm mostly interested in boost::thread.
    Well, it needs building but note that there will be multithreading in the upcoming C++ standard and most compilers have introduced parts of it so maybe <thread> is available in gcc already.

  6. #6
    Join Date
    Aug 2008
    Posts
    902

    Re: Building Boost for Mingw

    Quote Originally Posted by nuzzle View Post
    Well, it needs building but note that there will be multithreading in the upcoming C++ standard and most compilers have introduced parts of it so maybe <thread> is available in gcc already.
    Again, a problem with Mingw. I have tested std::thread in GCC and think it works great, but for some reason I can't get it to work in Mingw. I have a feeling it's not supported yet.

  7. #7
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Building Boost for Mingw

    What is the version of the MinGW port of g++ that you are using?
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  8. #8
    Join Date
    Aug 2008
    Posts
    902

    Re: Building Boost for Mingw

    Quote Originally Posted by laserlight View Post
    what is the version of the mingw port of g++ that you are using?
    4.5.2

  9. #9
    Join Date
    Aug 2008
    Posts
    902

    Re: Building Boost for Mingw

    Here is GCC's output on where it searches:

    Code:
    install: 
    C:\MinGW\lib\mingw32/4.5.2/
    
    programs:
    c:/mingw/lib/../../libexec/gcc/mingw32/4.5.2/;
    c:/mingw/lib/../../libexec/gcc/;
    C:/MinGW/lib/../../mingw32/bin/mingw32/4.5.2/;
    C:/MinGW/lib/../../mingw32/bin/
    
    libraries:
    C:/MinGW/lib/mingw32/4.5.2/;
    C:/MinGW/lib/;
    C:/MinGW/lib/../../mingw32/lib/mingw32/4.5.2/;
    C:/MinGW/lib/../../mingw32/lib/;
    C:/MinGW/lib/../mingw32/4.5.2/;
    C:/MinGW/lib/../;
    /mingw/lib/mingw32/4.5.2/;
    /mingw/lib/
    and it's all wrong, and the reason I'm having all my problems. Does anyone know how I can fix this?

  10. #10
    Join Date
    Mar 2010
    Location
    Melbourne Australia
    Posts
    454

    Re: Building Boost for Mingw

    for cross paltform dev you can't go wrong with with QT , comes with mingw , works great with boot , just decompress all header to include of mingw , as C:/QT/MingW/include , and the buildin IDE will pick it up straight away. you can grab a free one form here ,
    http://qt.nokia.com/downloads
    Last edited by aamir121a; February 5th, 2011 at 09:12 PM. Reason: typo

  11. #11
    Join Date
    Sep 2010
    Posts
    31

    Re: Building Boost for Mingw

    Also you can download Nuwen's MinGW distro which contains GCC 4.5.2 and Boost 1.45.0
    http://nuwen.net/mingw.html
    If you're having trouble building it... Feel free to ignore this comment if it's not what you want.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured