GCC/G++-11 on windows - windows

Hey I'm trying to compile a program that requires GCC and g++ 11. I've tried msys2 but it only goes up to GCC 10.04
And some of my libraries are supposed to be built on a mingw like environment. So is there any other way of running that program on a windows machine?

Get the latest MinGW-w64 GCC build from https://winlibs.com/

Related

Cygwin, choose between different GCC versions

I already had Cygwin installed, but I just ran the installer to get a later version of GCC.
Previously I was running GCC 4.9, I am now running 9.3. However, my code now runs approximately 20% slower.
To confirm the GCC version is the cause I would like to be able to compile it with GCC 4.9 again.
How do I do switch between using GCC 4.9 and 9.3?
you can try to install a older Cygwin with the older GCC
from the Cygwin Time Machine
http://www.crouchingtigerhiddenfruitbat.org/Cygwin/timemachine.html
I suggest you to make a parallel installation if you want to compare the results

Integrating Octave interpreter into program compiled with GCC 4.8.1

I'm trying to integrate Octave interpreter into my rigid body simulator compiled with GCC 4.8.1.
Following steps posted in the official documentation (https://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html) allow me to compile, link, and successfully execute the first example. Note, that I can link the executable with both mkoctfile.exe, or g++ when minGW 4.8.1 is added to PATH.
However, the second example showing how to embed the interpreter into my program compiles, links, and then segfaults on execution when GCC 4.8.1 binaries are in PATH. It works, when I use the supplied compiler (in my case it's gcc 4.6.2 shipped with octave 3.6.1 on windows).
Do I need to build octave from source using GCC 4.8.1 in order to successfully link program compiled using that version, or is there any other way to do so?
Using GCC 4.6.2 is not an option for me, as my program uses c++11 features not present in that version.
I just learned that there is a newer Octave version available at http://mxeoctave.osuv.de/ which was compiled with GCC 4.9.2. This version of GCC works for me perfectly and the second example provided in the documentation started to work when compiled with g++ provided with the distribution.

How to Compile 32-bit Apps on 64-bit RHEL?

I'm trying to compile a 32-bit C application on RHEL 7 64-bit using gcc 4.8. I'm getting a compiler error /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory. What do I need to do to get 32 bit apps compiled and linked?
To get RHEL 7 64-bit to compile gcc 4.8 32-bit programs, you'll need to do two things.
Make sure all the 32-bit gcc 4.8 development tools are completely installed:
sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686
Compile programs using the -m32 flag
gcc pgm.c -m32 -o pgm

sigc++ error during GTKmm cross-compilation

I wrote simple GTKmm program from here and try to cross-compile it for windows using mingw cross-compiler, but it fails. My output is here.
When I compile simple program using just GTK gtk.h header it works perfectly - compiles (using the same command) and run on Windows.
I am running Fedora LXDE spin and using GTKmm-2.4 (from win).
Everything else works fine - I can comile for UNIX GTK and GTKmm but for Win just GTK. I have my PKG_CONFIG_LIBDIR set properly (one for UNIX and one for Win)
Thanks for any advice - I also tried to install new libsigc++ from Yum Extender but nothing.
Fedora includes a number of MinGW cross compiled libraries, including gtkmm 2.4 and libsigc++. I see you are using gtkmm installed in /home/michal/Dropbox/GTK/GTKmm-Devel/; have you tried using the system packages?
To install the binary packages: 'yum install mingw32-gtkmm24'
... and then to compile the hello world sample, run:
i686-pc-mingw32-g++ helloworld.cc main.cc -o helloworld.exe `i686-pc-mingw32-pkg-config gtkmm-2.4 --cflags --libs`
Also, the Fedora MinGW project has a mailing list and an IRC channel where people can help get you started.

g++ produce executable for windows

I am using gcc/g++ to compile c/c++ applications - living on OpenSuSe btw.
Is there any way (some option i guess) so that g++ will produce an executable suitable for windows ?
You can search for a mingw32 package in OpenSuSE (I know there is one for Debian) or install it manually. Then if you have a configure script the command line would be something like this in order to have make use the MinGW cross-compilation toolchain:
./configure --prefix=/usr/local --target=i386-mingw32
mingw.org also has a tutorial on building a cross compiler, don't know if that works.
(As an aside: Some websites point to mirzam.it.vu.nl/mingw containing MinGW RPM packages but it seems like that site is down.)
You'll have to be running g++ on Windows to get a Windows executable out of the other end.
Check out mingw or cygwin.
Check out MinGW Cross and related links:
http://www.nongnu.org/mingw-cross-env/#see-also

Resources