C++11 compiler for windows

前端 未结 11 1435
我寻月下人不归
我寻月下人不归 2021-02-01 23:12

I was just watching a few videos on Channel9. I found things like lambdas really cool. when I tried to copy the example, it failed. auto didn\'t work either.

<
11条回答
  •  醉梦人生
    2021-02-01 23:19

    A special version of MinGW:

    MinGW-Builds gives you everything gcc offers (currently 4.7.2)

    That is: Including support for std::thread, std::async, std::future and friends.

    As far as I know that's by far the most complete C++11 you can get on Windows.

    You just get the MinGW-build binaries here. Unlike other gcc-based installations it supports posix threads, which are currently key to getting the gcc support for C++11 threads and friends working on Windows.

    Extract the directory mingw to any location and add the following two paths to your PATH environment variable: (well, change F:\coding ...)

    F:\coding\MinGW\bin
    F:\coding\MinGW\msys\1.0\bin
    

    Add both, separated by semi colon. You will need to log out or reboot. To verify that you got it right, you can open a command prompt, and write

    g++ --version 
    

    You should get a response like this, mentioning MinGW-builds:

    g++ (Built by MinGW-builds project) 4.7.2 
    Copyright (C) 2012 Free Software Foundation, Inc. ...
    

    I wrote a more complete instruction for getting this going with Eclipse, here: http://scrupulousabstractions.tumblr.com/post/36441490955/eclipse-mingw-builds

提交回复
热议问题