How do I point Cygwins compiler to a different version of GCC - windows

For example I have
D:/MinGW with gcc version 4.6.1
D:/cygwin/usr/bin/gcc has version 4.5.x
I would like to make Cygwin use my 4.6.1 version of GCC
Thanks

okey you have installed cygwin and Mingw both so now to use gcc 4.6.1 version of cygwin
1> go in cygwin folder you will find cygwin.bat file so run that file and use gcc
2> if you are planning to use gcc 4.6.1 in your IDE then set path of cygwin folder in that IDE and also set your windows environment path to cygwin/bin
3> if you have already set environment path to cygwin then open cmd write "bash" and start to use gcc 4.6.1
more you can find at here

You can usually do this with a symlink or changing PATH
Cygwin (and most platforms) will run the first gcc it finds in the PATH environment variable. So:
If PATH is: /usr/local/bin:/usr/bin:/bin then you can symlink your 4.6 version of gcc into /usr/local/bin or you can add /cygdrive/d/MinGW/ to the start of PATH.
However, note that cygwin and mingw are too separate platforms!

Related

How to specify MinGW64 for codeblocks 17.02 on Windows 10?

I have downloaded CodeBlocks 17.02 without mingw and installed it, then I downloaded MinGW64 from here(https://mingw-w64.org/doku.php/download) and only changed the architecture option from i686 to x86_64 during the installation and left the rest as default. Then tried to add this path to system paths: C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\bin. But when I opened the CodeBlocks, it couldn't find the compiler. Also when I go to settings>compiler and try to set GNU GCC compiler it says: can not find the compiler!
How should I specify the MinGW64 for CodeBlocks om Windows 10?
You need to setup the MinGW 8.1.0 in CodeBlocks.
The steps are: Settings -> Compiler -> GNU GCC Compiler -> Toolchain executables -> path\to\mingw64 (without bin). Then confirm.

How to build mingw32-make

I've just build a gcc 5.2.0 on windows according to this material:
http://preshing.com/20141108/how-to-install-the-latest-gcc-on-windows/
Everything went well. But then I've tried to build Qt with this newly built gcc and I'm getting an error that there is no mingw32-make. Checked directory and no, there isn't one.
But then I checked previously installed gcc, which was work of TDM, downloaded from:
http://tdm-gcc.tdragon.net/
and yes, in his build there is mingw32-make.
So, the question is, how is it that he has that tool, and many other which are absent in my build are present in his?
if you create from the gcc5.2.0 source, a build then you've just created the gcc compiler with all its necessary files. e.g. gcc-5.2.0.exe, gcc.exe, g++.exe, etc.
NOT the MinGW runtime environment for gcc, which contains the mingw32-make.exe !
if you follow your link from your question here you build it with the cygwin make.exe.
It's better to download the mingw 32 binary runtime environment for gcc
or
MinGW64 runtime environment for gcc
Then you have all the files needed to work with QT.
if you want to create a mingw build from source, you need first a MinGW runtime environment then you can use that to build your own mingw32-make.exe.

MinGW gcc failed to find head files in /local/include

When I run
gcc test.c
in the terminal of msys,
I get the error
test.c:1:18: fatal error: x264.h: No such file or directory
#include <x264.h>
I can find the x264.h in /local/include
$ ls /local/include/
x264.h x264_config.h
Why MinGW gcc doesn't search the default place?
It's not a "default place" for MinGW GCC. The fact that you're calling native Win32 GCC from the MSYS shell does not mean it knows about these Unix paths MSYS conjures up.
Either install to the / directory or add your 3rd party library directory to the include paths on the commandline:
-I/local/include
Note the above only works from within the MSYS shell.

CMake Project use local g++ version

I'm using MacOS X Lion with XCode 4.2.1. and I need gcc 2.4.6. to compile a CMake project. Therefor I build gcc 2.4.6. on my own in a local directory $HOME/mygcc/bin. Is there a way to influece the path to the compiler CMake uses?
You can either use the GUI to set these variables:
CMAKE_C_COMPILER=$HOME/mygcc/bingcc
CMAKE_CXX_COMPILER=$HOME/mygcc/bing++
Or you can run cmake from the commandline:
cmake ../path/to/source -DCMAKE_C_COMPILER=$HOME/mygcc/bin/gcc -DCMAKE_CXX_COMPILER=$HOME/mygcc/bin/g++
You can set your local gcc bin directory into your $PATH before running cmake:
$ export PATH=$HOME/mygcc/bin:$PATH
$ cmake

Can't compile with MinGW - libmpc-2.dll is missing

I have installed MinGW in Windows Vista, so I can use gcc but it doesn't work.
When I try to compile a .c file like gcc hello.c -o hello.exe I get an error (translated):
cc1.exe: could not find libmpc-2.dll
How can I fix this?
I had the same problem. Installing the mpc package with mingw-get solved it for me.
Open a command line window
Go to your MinGW\bin directory: e.g. cd MinGW\bin
execute: mingw-get install mpc
I have today same problem in Windows 7. All DLL's was in folder with MinGW. Only copying DLL's in SYSTEM32 folder solved this
Copy this file into the directory where your gcc executable can be found (the one named bin).
http://www38.zippyshare.com/v/95754574/file.html
The strange thing is that the MinGW installation of mine included this dll correctly.

Resources