Thread: Command Line g++ Issues

  1. #1
    Registered User
    Join Date
    Mar 2016

    Command Line g++ Issues

    I'm trying to compile a simple program with g++ from the command line. When I checked my laptop's PATH I see that it already includes a compiler from the Dev-C++ download: C:\Program Files (x86)\Dev-Cpp\MinGW64\bin and so I did not install anything else and tried both:

    F:\demo>g++ demo2.cpp


    F:\demo\g++ -o demo2 demo2.cpp

    and in both cases I get the error message:

    g++: error: CreateProcess: No such file or directory

    though when I run F:\>cd demo I can see the demo2.cpp file listed in this folder

    I am wondering if the g++ from the Dev-C++ download is the issue here and if I need to remove this from the PATH and download the compiler separately and add it to the PATH. Any help, as ever, much appreciated. Thanks

  2. #2
    Does plain g++ --version work? I think the spaces in Program Files (x86) might be tripping it up.

    I would suggest to place compiler toolchains (and libraries you build) into a path without spaces, e.g. C:\dev\MinGw64. That's not quite in line with Windows' standard location for binary files, but imo the best solution to save yourself headaches later on.

    Since someone else also asked a GCC related question today, I'll just repeat myself and recommend mingw-w64 builds, e.g. this collection. I never had any issues with those and they support std::thread on Windows, which is nice.

  3. #3
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Are there other Windows C++ compilers that don't support std::thread? Oh... Oh god...

  4. #4
    That's what I remember being an issue dealing with GCC based toolchains on Windows, but maybe it's a non-issue now. Something about winpthreads, licensing issues, etc. where users stuck to the Windows API for thread management instead of the "new" C++11 features.

  5. #5
    Join Date
    Oct 2007
    Inside my computer
    Quote Originally Posted by MutantJohn View Post
    Are there other Windows C++ compilers that don't support std::thread? Oh... Oh god...
    You know, GCC is a GNU software, which means C is the language that must be used to build it (I think it's some kind of rule at this point) and Linux primary and Windows is just... an afterthought.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Mar 2016
    @Guest: Thank you for the suggestion, the mingw-w64 builds work perfectly. In fact, even the CodeBlocks\MinGw\bin works fine, it seems to be a Dev-cpp issue in my case. Cheers,

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    > I am wondering if the g++ from the Dev-C++ download is the issue here
    If you're talking about the bloodshed dev-c++, you need to realise that it's been abandonware for at least a decade. The compiler is way out of date with respect to current versions of GCC, and the IDE itself was notoriously buggy.

    There is a maintained fork of dev-c++ here.
    Dev-C++ download |
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Command line argument parsing issues?
    By the_jackass in forum C Programming
    Replies: 7
    Last Post: 10-03-2014, 03:22 AM
  2. Line segment intersection code issues.
    By ~Kyo~ in forum Game Programming
    Replies: 6
    Last Post: 03-19-2012, 01:28 AM
  3. Command line how to handle optional command.
    By ovid in forum C++ Programming
    Replies: 1
    Last Post: 03-07-2010, 11:41 PM
  4. line break issues
    By bbeltwilson in forum C++ Programming
    Replies: 5
    Last Post: 12-28-2008, 04:00 PM
  5. Borland command line compiler issues.
    By NinePin in forum C Programming
    Replies: 5
    Last Post: 09-05-2002, 05:44 PM

Tags for this Thread