The folder/directory structure and naming scheme for MinGW-64 is very confusing and makes no logical sense to me. I also need these same questions answered for the 圆4 profile, because I know that often a person must utilize different headers and library files for 64-bit compilation as those for 32-bit programs. which executables do I list for the "Program Files" sub-tab under "Toolchain executables"? which folder(s) do I list for the "Compiler" sub-tab under "Search directories"?Ĥ. which folder(s) do I list for the "Linker" sub-tab under "Search directories"?ģ. which folder(s) do I list for the "Compiler" sub-tab under "Search directories"?Ģ.
#How to use mingw w64 how to
I know basically how to create each setting profile, but I don't know the correct info to include in each profile - most specifically, those under the "Search Directories" tab and the "Toolchain Executables" tab.ġ. I want to create two separate compiler setting profiles:ġ.) "MinGW-64 (GNU GCC) x86 Compiler" for 32-bit programs 2.) "MinGW-64 (GNU GCC) 圆4 Compiler" for 64-bit programs
#How to use mingw w64 windows
I'm wanting to graduate from the included 32-bit MinGW and I am trying to setup MinGW-64 v4.9.0.2 to use with Code::Blocks on 64-bit Windows 8.1. If the compiler isn't already pre-configured in the IDE, I'm pretty much screwed. I have good experience with 64-bit programming, just not so while using either Code:Blocks or MinGW-64. Even though I'm pretty good at coding, when it comes to setting up compilers to use with an IDE, I tend to be an absolute airhead. Both files should be in an identical folder.Īfter running "compile.m", you should be able to see the output message "From C++: Hello world!" in the Matlab command window.Right off the bat, this is NOT an an error of any sorts with Code::Blocks, it has more to do with my own incompetence. In the following files, you can try to build a test mex function. This should give you the following output: MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation.
► Choose the destination folder for installation (in my case "C:\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0") and go to next steps.Īfter installation, to inform the path of the compiler to Matlab, you can write in Matlab command-window, or directly in your m-file the following command. ► Select the proper version (5.3.0) and architecture (in my case "x86_64").
#How to use mingw w64 download
► Download and run mingw-w64 installer file -> link: mingw-w64-install.exe In Matlab R2017a, it gives you the following output: MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation. To test whether the compiler is set correctly, type the following command in the Matlab Command Window mex -setup C++ Replace the given default installation path of the compiler, if you changed it. Now, to inform the path of the compiler to Matlab, you can write in Matlab command-window, or directly in your m-file the following command. ► In front of gcc section, make sure that the correct version 4.9.2 is given if not, you probably forgot to uncheck updates in the beginning. ► If you are going to write programs with parallel computations, make sure to check OpenMP in optional components - gcc. ► Uncheck box "Check for updated files on the TDM-GCC server". ► Download the compiler binary file -> link: tdm64-gcc-4.9.2-3.exe Instructions are given below for both categories.
◼ For Matlab R2017b, MinGW 5.3 is required. ◼ For Matlab R2015b up to R2017a, you can use MinGW 4.9.2 TDM-GCC.