Author Topic: MinGW 64 bit and Code::Blocks (how to)  (Read 62088 times)


  • Guest
MinGW 64 bit and Code::Blocks (how to)
« on: July 31, 2010, 06:12:09 pm »
This is more geared towards new users that are running Windows. Hopefully it will save people some headaches.

Here's the easiest way that I've found to set up Code::Blocks and MinGW for 64-bit compiling on MS Windows...

I recently found this site:

Go there and grab this file (or newer): mingw-w64-bin-x86_64-20100709.7z

Get 7zip

Open the mingw-w64 archive with 7zip, select Copy To, and pick a locating to extract the files.

Find the mingw64 folder you just extracted, right click on it and Cut/Paste it into a path without spaces (ie C:\). Full path should be like "C:\mingw64".

Open Code::Blocks and click on Settings->Compiler and debugger. Under Selected Compiler, click Copy. In the next box, type something like "MinGW 64-bit Compiler" and click OK.

Then on the Toolchain executables tab, I had to click the Browse button beside each option and browse to the newly created C:\mingw64\bin folder to set each option as follows (just changing the main path to the compiler didn't work):

Compiler's installation directory: C:\mingw64

C compiler: gcc.exe
C++ compiler: g++.exe
Linker for dynamic libs: g++.exe
Linker for static libs: ar.exe
Debugger: There isn't one for MinGW 64-bit yet, clear this and leave it blank
Resource compiler: windres.exe
Make program: make.exe

After a test compile, GnuWin32 File says:

Enjoy  :D

Offline ssssssara

  • Single posting newcomer
  • *
  • Posts: 2
Re: MinGW 64 bit and Code::Blocks (how to)
« Reply #1 on: February 08, 2011, 08:57:42 am »
I am trying to get this to work, since I need to compile my project for both 32-bit and 64-bit Windows. But even though I made every step above (and more, and multiple times!) I can't get it to work!

When I have configured the compiler, as described above, and chosen this compiler for my project,  I clean and then rebuild, and I get the following:


Compiling: Program.c
Execution of 'gcc.exe -Wall -std=c99 -DBUILD_DLL  -Wall -g -std=c99 -DBUILD_DLL -DVERBOSE -DVERBOSE_ERROR  -Wall -std=c99   -Icurl-7.21.1-devel-mingw32\include -Icurl-7.21.1-devel-mingw32\include  -c C:\Users\sara\Desktop\Program_win64\Program.c -o obj\Debug\Program.o' in 'C:\Users\sara\Desktop\Program_win64' failed.
Nothing to be done.

Have anyone encountered the same or similar problem, and did you solve it somehow?
Is there any other way to compile for 64bit with Code::Blocks??
Thankful for any help or tip!
« Last Edit: February 08, 2011, 09:09:06 am by ssssssara »


  • Guest
Re: MinGW 64 bit and Code::Blocks (how to)
« Reply #2 on: February 10, 2011, 02:47:14 pm »
Thanx for this how to.
I've still have one problem by using the MinGW 64 compiler.

It's about the linker
I've include Mysql/mysql.h and paste the MYSQL folder in C:\mingw64\x86_64-w64-mingw32\include
That's ok
But even if I link with libmysqlclient.a (I've tried to put it in several folders), when I try to build, I still have :
undefined reference to `mysql_init'
undefined reference to `mysql_options'
I don't know if something is missing?
Thank you for your help