Long story short:
I need to help updating the gcc compiler that mingw uses to compile for windows within my linux build environment. When I installed the mingw version available by default in the Ubuntu repositories (3.0), I get an old version of the gcc compiler (4.6.3). However, I need at least version 4.7 for what I am trying to compile. I have installed a more recent version of mingw (3.5.8) that contains gcc version 2.8.2, but I have been unable to use it since the previous version of mingw is still taking precedent over it.
More context to my question:
I have been struggling for a while now trying to cross-compile some code, which already works in linux, for Windows. When done correctly, my code should compile to a Windows DLL file to be used in conjunction with a larger software package,which already works in Windows.
I have already set up mingw to cross-compile c code written in linux into windows EXEs. That works fine as long as the programs are simple. But for what I really want to do, I need to include more complicated elements and build the project with ./configure, make, make install. To do this, I know that I need to use a command something like this:
To configure it for the cross-compilation. However, when I “make,” I get an error saying,
./configure --host=x86_64-w64-mingw32--build=x86_64-w64-mingw32 –with-dest=$PWD/_install
which I have learned means that I am using a gcc compiler that is too out of date.
x86_64-w64-mingw32-gcc: error:unrecognized option '-pthread'
Of course I have more up-to-date gcc compilers on my system, but they are for linux target systems. The one that came with mingw, by default, is too old. So to do this, I installed a more recent version of mingw from source, which compiled a newer version of gcc. Great. Except that I cannot figure out how to use it.
When I try ./configure, it is still targeting the old installation of mingw, and its out-of-date gcc.
How can I specify the new mingw (and/or new gcc) for configuring, make, install?
And/or, make my new version of mingw the default?