Discussion:
[Mingw-users] How to install MinGW with an older compiler version (gcc/g++ 4.6.X)?
Frédéric Bron
2012-07-05 20:44:08 UTC
Permalink
I had to reinstall MinGW and it came with gcc/g++ 4.7.0. However, I
get some issues when I use it with wxwidgets (strange seg faults)
while gcc/g++ 4.6.2 worked well before.
How can I install MinGW with gcc/g++ 4.6.2 or 4.6.3?
Regards,
Frédéric
Keith Marshall
2012-07-05 21:15:21 UTC
Permalink
Post by Frédéric Bron
I had to reinstall MinGW and it came with gcc/g++ 4.7.0. However, I
get some issues when I use it with wxwidgets (strange seg faults)
while gcc/g++ 4.6.2 worked well before.
How can I install MinGW with gcc/g++ 4.6.2 or 4.6.3?
Please read the release notes for mingw-get-0.5; the bullet point
"Forced installation of a specified (non-current) release" describes
this feature, (and how to use it).

BTW, it's likely that your segfaults may be the result of ABI breakage
in the GCC-4.6 --> GCC-4.7 transition; it's important to ensure that
*all* of your libraries are compiled with ABI consistent versions of the
compiler -- ideally all with the *same* version.
--
Regards,
Keith.
Frédéric Bron
2012-07-06 02:31:51 UTC
Permalink
Post by Keith Marshall
Please read the release notes for mingw-get-0.5; the bullet point
"Forced installation of a specified (non-current) release" describes
this feature, (and how to use it).
thanks, it worked.
Post by Keith Marshall
BTW, it's likely that your segfaults may be the result of ABI breakage
in the GCC-4.6 --> GCC-4.7 transition; it's important to ensure that
*all* of your libraries are compiled with ABI consistent versions of the
compiler -- ideally all with the *same* version.
when I cross compile from linux, I use the same compiler for all my
libs (boost, wxwidgets) and my programs and the program crashes in
release mode, not in debug mode (not easy to debug!).
I switched back to 4.6.2. Then I can cross compile the libraries from
linux and compile the program in windows with codeblocks and mingw and
every thing is fine. The same procedure with 4.7 does not work.

Thanks again for your help,

Cheers,

Frédéric
Post by Keith Marshall
--
Regards,
Keith.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
MinGW-users mailing list
This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
_______________________________________________
https://lists.sourceforge.net/lists/listinfo/mingw-users
--
Frédéric Bron

-----------------------------------------------------------
Frédéric Bron (***@m4x.org)
Villa des Quatre Chemins, Centre Hospitalier, BP 208
38506 VOIRON CEDEX
tél. : (33) 4 76 67 17 27
Zouzou
2012-07-06 08:08:58 UTC
Permalink
Post by Frédéric Bron
when I cross compile from linux, I use the same compiler for all my
libs (boost, wxwidgets) and my programs and the program crashes in
release mode, not in debug mode (not easy to debug!).
I switched back to 4.6.2. Then I can cross compile the libraries from
linux and compile the program in windows with codeblocks and mingw and
every thing is fine. The same procedure with 4.7 does not work.
i've had the exact same problem when switching from GCC 4.6 to 4.7;
traced it to a new optimization behavior, that i disabled by adding the
-fno-ipa-cp-clone flag when compiling.

Zouzou
Frédéric Bron
2012-07-08 05:42:36 UTC
Permalink
Post by Zouzou
i've had the exact same problem when switching from GCC 4.6 to 4.7;
traced it to a new optimization behavior, that i disabled by adding the
-fno-ipa-cp-clone flag when compiling.
Thanks, I will try that. That's the only clue I have. Meanwhile, I
came back to 4.6.2.
Frédéric
Frédéric Bron
2012-07-08 11:13:34 UTC
Permalink
Post by Zouzou
i've had the exact same problem when switching from GCC 4.6 to 4.7;
traced it to a new optimization behavior, that i disabled by adding the
-fno-ipa-cp-clone flag when compiling.
It did not work for me.
I will probably wait a long time before trying again to switch 4.7...
Regards,
Frédéric
Earnie Boyd
2012-07-06 11:44:20 UTC
Permalink
Post by Frédéric Bron
I had to reinstall MinGW and it came with gcc/g++ 4.7.0. However, I
get some issues when I use it with wxwidgets (strange seg faults)
while gcc/g++ 4.6.2 worked well before.
You'll need to rebuild wxwidgets library with gcc/g++ 4.7.0. There
are ABI breakages for both C and C++.
Post by Frédéric Bron
How can I install MinGW with gcc/g++ 4.6.2 or 4.6.3?
I don't remember the syntax exactly but it is something like:

mingw-get install --reinstall gcc-4.6.3
--
Earnie
-- https://sites.google.com/site/earnieboyd
Edward Diener
2012-07-07 19:24:16 UTC
Permalink
Post by Frédéric Bron
I had to reinstall MinGW and it came with gcc/g++ 4.7.0. However, I
get some issues when I use it with wxwidgets (strange seg faults)
while gcc/g++ 4.6.2 worked well before.
How can I install MinGW with gcc/g++ 4.6.2 or 4.6.3?
I always install all the MingW gcc versions separately in their own
directory and then robocopy whichever one I want to use into the general
MingW directory structure. I have always found this a lot easier and
quicker than trying to use any of the features of mingw-get.
Frédéric Bron
2012-07-08 05:40:56 UTC
Permalink
Post by Edward Diener
I always install all the MingW gcc versions separately in their own
directory
How do you do that?
Frédéric
Edward Diener
2012-07-09 05:30:12 UTC
Permalink
Post by Frédéric Bron
Post by Edward Diener
I always install all the MingW gcc versions separately in their own
directory
How do you do that?
Go to the appropriate GCC directory from
http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/. Pick a
version and manually download all the appropriate .lzma files. Expand
them into the directory of your choice.

Then create batch files to robocopy the release you want to the main
MingW directory as needed.

That way you can test any version of MingW gcc you want in Boost, or
otherwise.

I find mingw-get and the GUI version still too primitive for flexible use.
LRN
2012-07-09 07:12:13 UTC
Permalink
Post by Frédéric Bron
Post by Edward Diener
I always install all the MingW gcc versions separately in their
own directory
How do you do that?
1) Download and install mingw-get into your MinGW directory. Configure
it to use separate directories for MinGW and MSYS (i think it already
does by default, but it's best to make sure), be sure to use patterns
(%r, i think?) instead of hard-coded absolute paths.

2) Use mingw-get to install gcc version you want, and all libraries
and programs you need.

Repeat 1) and 2), installing into different MinGW directories, but
configuring the same MSys directory.

When you need to switch to a different MinGW version - edit
/etc/fstab, change the directory to which /mingw points, then run
`mount -a' in MSYS.

If you are not using MSys, it's a bit more involved. You'd want to
install MinGWs into differently named directories, then create a
directory symlink (or a junction, if you're using NT version earlier
than 6) with a generic name (say, c:/mingw32), and make it link to one
of your MinGW directories. When you need to switch to a different
MinGW version, you just change the directory the link points at.

Both editing /etc/fstab and re-mounting AND changing the link/junction
can be automated with conveniently-named scripts and switch your MinGW
version faster than copying would.

Note that you'll be switching the whole MinGW subsystem (with
libraries and anything else you've installed into MinGW directory).
This is intentional - due to ABI changes between gcc versions chances
are, you'll have to re-compile everything anyway.
Keith Marshall
2012-07-09 13:26:36 UTC
Permalink
Post by LRN
Post by Frédéric Bron
Post by Edward Diener
I always install all the MingW gcc versions separately in their
own directory
How do you do that?
1) Download and install mingw-get into your MinGW directory. Configure
it to use separate directories for MinGW and MSYS (i think it already
does by default, but it's best to make sure), be sure to use patterns
(%r, i think?) instead of hard-coded absolute paths.
%R is the configuration macro you want; it represents the effective root
directory of the mingw-get installation tree -- i.e. the immediate
parent of the "bin" directory in which mingw-get.exe resides -- but the
macro name is case-sensitive.
Post by LRN
2) Use mingw-get to install gcc version you want, and all libraries
and programs you need.
Repeat 1) and 2), installing into different MinGW directories, but
configuring the same MSys directory.
With all mingw-get releases to date, yes.

Note that this implies having a separate mingw-get installation
associated with each independent MinGW installation. In a future
release, I plan to add a capability for managing multiple independent
MinGW and/or MSYS installations from a single mingw-get installation,
via "system-map" specifications in the profile.xml file, but I'm not
making any promises as to when I'll get the details worked out.

If you are using the separate installations approach, you might consider
symlink/junction sharing of the %R/var/cache directory among them all,
to avoid repeated downloads of common packages.
--
Regards,
Keith.
Allann Jones
2012-07-17 21:17:25 UTC
Permalink
Post by Frédéric Bron
I had to reinstall MinGW and it came with gcc/g++ 4.7.0. However, I
get some issues when I use it with wxwidgets (strange seg faults)
while gcc/g++ 4.6.2 worked well before.
How can I install MinGW with gcc/g++ 4.6.2 or 4.6.3?
Regards,
Frédéric
I use wxWidgets from trunk and MinGW latest updates with GCC 4.7 (default
installation with mingw-get) without problems, with or without debug mode.

My apps are working with GCC 4.7 without modifications.

I don't use optimizations flags, only -Wall.

Is there a possible problem on your application code?


On Mon, Jul 9, 2012 at 9:26 AM, Keith Marshall <
Post by Frédéric Bron
Post by LRN
Post by Frédéric Bron
Post by Edward Diener
I always install all the MingW gcc versions separately in their
own directory
How do you do that?
1) Download and install mingw-get into your MinGW directory. Configure
it to use separate directories for MinGW and MSYS (i think it already
does by default, but it's best to make sure), be sure to use patterns
(%r, i think?) instead of hard-coded absolute paths.
%R is the configuration macro you want; it represents the effective root
directory of the mingw-get installation tree -- i.e. the immediate
parent of the "bin" directory in which mingw-get.exe resides -- but the
macro name is case-sensitive.
Post by LRN
2) Use mingw-get to install gcc version you want, and all libraries
and programs you need.
Repeat 1) and 2), installing into different MinGW directories, but
configuring the same MSys directory.
With all mingw-get releases to date, yes.
Note that this implies having a separate mingw-get installation
associated with each independent MinGW installation. In a future
release, I plan to add a capability for managing multiple independent
MinGW and/or MSYS installations from a single mingw-get installation,
via "system-map" specifications in the profile.xml file, but I'm not
making any promises as to when I'll get the details worked out.
If you are using the separate installations approach, you might consider
symlink/junction sharing of the %R/var/cache directory among them all,
to avoid repeated downloads of common packages.
--
Regards,
Keith.
Frédéric Bron
2012-07-17 22:46:19 UTC
Permalink
Post by Allann Jones
My apps are working with GCC 4.7 without modifications.
I don't use optimizations flags, only -Wall.
Is there a possible problem on your application code?
I use -O3 flag. Maybe that's causing the issue. Maybe I should try
without to see if it works.
Frédéric

Continue reading on narkive:
Search results for '[Mingw-users] How to install MinGW with an older compiler version (gcc/g++ 4.6.X)?' (Questions and Answers)
5
replies
What is the latest version of C++ compiler?
started 2010-02-07 03:25:12 UTC
programming & design
Loading...