# Error relating to C++ compiler when running ./configure on Windows

**URL:** <https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454>\
**Category:** Uncategorized\
**Tags:** installation, windows\
**Created:** [September 19, 2016, 4:22am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454 "2016-09-19T04:22:33Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![tplillicrap](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tplillicrap](https://community.mrtrix.org/u/tplillicrap)\
**Post date:** [September 19, 2016, 4:22am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/1 "2016-09-19T04:22:33Z")

</div>

I am encountering the following error on my Windows 7 desktop.  
I followed the Windows installation instructions and all went well through cloning the MRtrix3 repository.  
When trying to build the MRtrix, I type

```auto
cd MRtix3 
./configure
```

I get an error stating that a compatible C++11 compiler has not been found. configure.log text is pasted below:

```auto
REPORT: 
MRtrix build type requested:

REPORT: release

REPORT: 

REPORT: Detecting OS: windows

REPORT: Checking for C++11 compliant compiler [g++]:
EXEC <<
CMD: g++ -dumpversion
error invoking command "g++": No such file or directory: 'g++'
>>

ERROR: compiler not found!

  MRtrix3 was unable to find an appropriate C++11 compiler.

  Set the CXX environment variable to inform 'configure' of the path to the
  compiler on your system, as follows:
    $ export CXX=/usr/bin/g++-5.5
    $./configure
  (amend with the actual path to the compiler on your system)

  See the file 'configure.log' for details. If this doesn't help and you need
  further assistance, please post on the MRtrix3 community forum
  (http://community.mrtrix.org/), and make sure to include the full contents of
  the 'configure.log' file.
```

The “configure.log” file contains exactly the same text as the error message (the above was actually copied from the configure.log file) and nothing else.

I’m very new to this (mostly have previous experience of “point and click” computing) so I’m not sure which file/folder to point the CXX command to. I cannot find anything called “g++”, the only thing I’ve found that I think might contain a C++ compiler is a folder called “gcc”, but again, I’m not sure of which file within this folder to point the CXX towards.

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [September 19, 2016, 4:47am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/2 "2016-09-19T04:47:41Z")

</div>

Hi there,

It’s unusual for `g++` to not be present in your path if [this line from the installation instructions](https://mrtrix.readthedocs.io/en/latest/installation/build_from_source.html#windows) worked successfully:  
`pacman -S git python pkg-config mingw-w64-x86_64-gcc mingw-w64-x86_64-eigen3 mingw-w64-x86_64-qt5`  
Are you definitely sure that this step worked?

Otherwise, if you can see a directory called `gcc` (hopefully in `/usr/local/` or similar location), you want to set the `CXX` environment variable to the path to a binary in that directory that starts with `g++`: it could be `g++`, `g++-5`, `g++-5.5` or some variant thereof.

If you’re still stuck, you can try running this and providing us with the output:  
`pacman -Ql mingw-w64-x86_64-gcc`  
That should print a list of the files provided by the `gcc` package.

Cheers  
Rob

---

<div class="post-metadata">

**Author:** ![tplillicrap](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tplillicrap](https://community.mrtrix.org/u/tplillicrap)\
**Post date:** [September 19, 2016, 6:03am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/3 "2016-09-19T06:03:10Z")

</div>

Thanks very much,  
I didn’t get any error messages when I ran the above step so I believe it worked.  
I did manage to find the g++ file (although it was not in the gcc folder confusingly enough). I set the CXX variable to the file path for the file as follows:  
`$ export CXX=C:/msys64/mingw64/bin/g++`  
This allowed the program to detect the g++ but then the compiler test failed. Configure log text is below:

```auto
REPORT: 
MRtrix build type requested:

REPORT: release

REPORT: 

REPORT: Detecting OS: windows

REPORT: Checking for C++11 compliant compiler [C:/msys64/mingw64/bin/g++.exe]:
EXEC <<
CMD: C:/msys64/mingw64/bin/g++.exe -dumpversion
EXIT: 0
STDOUT:
6.1.0
>>

REPORT: 6.1.0

COMPILE /tmp/tmp58deenlk.cpp:
---

struct Base {
    Base (int);
};
struct Derived : Base {
    using Base::Base;
};

int main() {
  Derived D (int); // check for contructor inheritance
  return (0);
}

---
EXEC <<
CMD: C:/msys64/mingw64/bin/g++.exe -c -std=c++11 -pthread -DMRTRIX_WINDOWS -mms-bitfields -Wa,-mbig-obj -march=native /tmp/tmp58deenlk.cpp -o /tmp/tmp58deenlk.o
EXIT: 1
>>

error deleting temporary file "/tmp/tmp58deenlk.o": No such file or directory
ERROR: compiler test failed!

  MRtrix3 was unable to compile a simple C++ program.

  Set the CXX environment variable to inform 'configure' of the path to the
  compiler on your system, as follows:
    $ export CXX=/usr/bin/g++-5.5
    $./configure
  (amend with the actual path to the compiler on your system)

  If you are using a compiler other than gcc, you can also set the CXX_ARGS
  environment variable to specify how your compiler expects different arguments
  to be presented on the command line, for instance as follows:
    $ export CXX_ARGS="-c CFLAGS SRC -o OBJECT"
    $ ./configure

  See the file 'configure.log' for details. If this doesn't help and you need
  further assistance, please post on the MRtrix3 community forum
  (http://community.mrtrix.org/), and make sure to include the full contents of
  the 'configure.log' file.
```

Any further advice would be greatly appreciated.  
Cheers,  
Tom

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [September 19, 2016, 6:31am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/4 "2016-09-19T06:31:10Z")

</div>

I had issues like this at one point, which I eventually tracked down to using the wrong shell. MSYS2 provides 3 shells, and for things to work we need the _MinGW-w64 Win64 Shell_. Are you sure you’re starting up with this shell when you start the terminal?

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [September 19, 2016, 6:36am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/5 "2016-09-19T06:36:10Z")

</div>

_(Sorry I keep editing your posts, but surrounding the logs with `[code]` … `[/code]` makes them [much more readable](https://community.mrtrix.org/t/formatting-tricks-for-increased-readability/34))_

OK, that’s an unusual one. Though I do have some vague recollection of having had GCC version 6 installed with MSYS2 and having to revert to version 5…

If necessary I’ll try to reproduce tonight and give you more precise instructions (and update the documentation). But what I think you need to do is uninstall GCC version 6, find a package for GCC version 5, and install that.

- To remove version 6: `pacman -R mingw-w64-x86_64-gcc`

- To install version 5 will require a bit of searching around. You can try: `pacman -Ss gcc`: That should give you a list of available packages that contain ‘gcc’ in the name. Look for something that has the version number (5) in the title, or anything that has `msys2` rather than `mingw` at the start of the package name. If nothing there works, you could maybe try `mingw-w64-x86_64-toolchain` instead of `mingw-w64-x86_64-gcc`. You may have to update (or just erase) the `CXX` environment variable so that the newly installed program is found. The `CXX_ARGS` variable won’t be of any use to you: that’s there for compilers other than `gcc`.

Make sure you check @jdtournier’s instruction too. Note that this suggestion applies not only to which shell you use, but also that the shell shortcuts need to be updated following the `update-core` step in the [instructions](http://mrtrix.readthedocs.io/en/latest/installation/windows_install.html#install-and-update-msys2).

---

<div class="post-metadata">

**Author:** ![tplillicrap](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tplillicrap](https://community.mrtrix.org/u/tplillicrap)\
**Post date:** [September 19, 2016, 6:40am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/6 "2016-09-19T06:40:30Z")

</div>

Thanks very much to you both.  
I am using the correct shell, and I have reset the shortcuts as instructed (although that also took me a while to figure out).  
I’ll try uninstalling GCC version 6 and replacing it overnight and let you know how I go.

Thanks again,  
Tom

---

<div class="post-metadata">

**Author:** ![tplillicrap](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tplillicrap](https://community.mrtrix.org/u/tplillicrap)\
**Post date:** [September 21, 2016, 1:50am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/7 "2016-09-21T01:50:14Z")

</div>

I managed to find gcc version 5.3.0-3 in msys and install it.  
That appears to have fixed the C++ compiler problem but now I get an error at the next step of the configure process (detecting pointer size).

Configure log is below (and I’ve hopefully got the (code) surrounding correct, apologies if not.

```auto

REPORT: 
MRtrix build type requested:

REPORT: release

REPORT: 

REPORT: Detecting OS: windows

REPORT: Checking for C++11 compliant compiler [C:/msys64/usr/bin/gcc]:
EXEC <<
CMD: C:/msys64/usr/bin/gcc -dumpversion
EXIT: 0
STDOUT:
5.3.0
>>

REPORT: 5.3.0

COMPILE /tmp/tmpvpm1i_p7.cpp:
---

struct Base {
    Base (int);
};
struct Derived : Base {
    using Base::Base;
};

int main() {
  Derived D (int); // check for contructor inheritance
  return (0);
}

---
EXEC <<
CMD: C:/msys64/usr/bin/gcc -c -std=c++11 -pthread -DMRTRIX_WINDOWS -mms-bitfields -Wa,-mbig-obj -march=native /tmp/tmpvpm1i_p7.cpp -o /tmp/tmpvpm1i_p7.o
EXIT: 0
>>

EXEC <<
CMD: C:/msys64/usr/bin/gcc /tmp/tmpvpm1i_p7.o -pthread -Wl,--allow-multiple-definition -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>

REPORT: - tested ok

REPORT: Detecting pointer size:

COMPILE /tmp/tmp1b891ftg.cpp:
---

#include <iostream>
int main() {
  std::cout << sizeof(void*);
  return (0);
}

---
EXEC <<
CMD: C:/msys64/usr/bin/gcc -c -std=c++11 -pthread -DMRTRIX_WINDOWS -mms-bitfields -Wa,-mbig-obj -march=native /tmp/tmp1b891ftg.cpp -o /tmp/tmp1b891ftg.o
EXIT: 0
>>

EXEC <<
CMD: C:/msys64/usr/bin/gcc /tmp/tmp1b891ftg.o -pthread -Wl,--allow-multiple-definition -o a.out
EXIT: 1
STDERR:
/tmp/tmp1b891ftg.o:tmp1b891ftg.cpp:(.text+0x1a): undefined reference to `std::ostream::operator<<(unsigned long)'
/tmp/tmp1b891ftg.o:tmp1b891ftg.cpp:(.text+0x1a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `std::ostream::operator<<(unsigned long)'
/tmp/tmp1b891ftg.o:tmp1b891ftg.cpp:(.text+0x4e): undefined reference to `std::ios_base::Init::Init()'
/tmp/tmp1b891ftg.o:tmp1b891ftg.cpp:(.text+0x4e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `std::ios_base::Init::Init()'
/tmp/tmp1b891ftg.o:tmp1b891ftg.cpp:(.rdata$.refptr._ZNSt8ios_base4InitD1Ev[.refptr._ZNSt8ios_base4InitD1Ev]+0x0): undefined reference to `std::ios_base::Init::~Init()'
/tmp/tmp1b891ftg.o:tmp1b891ftg.cpp:(.rdata$.refptr._ZSt4cout[.refptr._ZSt4cout]+0x0): undefined reference to `std::cout'
collect2: error: ld returned 1 exit status
>>

error deleting temporary file "a.out": No such file or directory
ERROR: unable to determine pointer size!

  See the file 'configure.log' for details. If this doesn't help and you need
  further assistance, please post on the MRtrix3 community forum
  (http://community.mrtrix.org/), and make sure to include the full contents of
  the 'configure.log' file.

```

Any ideas? I’m not 100% confident I installed the gcc compiler correctly but it looks like the system detected and tested the compiler successfully so hopefully this is no longer the problem.

Thanks again,  
Tom

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [September 21, 2016, 2:14am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/8 "2016-09-21T02:14:41Z")

</div>

Ah yes. This is something I’ve been meaning to look into more closely. In my personal experience, `configure` on Windows often fails at the pointer size detection step the first time, but if you simply re-run `configure` a second time, it then works. Can you try simply running it a few times?

---

<div class="post-metadata">

**Author:** ![tplillicrap](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tplillicrap](https://community.mrtrix.org/u/tplillicrap)\
**Post date:** [September 21, 2016, 3:34am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/9 "2016-09-21T03:34:16Z")

</div>

That eventually worked after I exited the shell and re-opened it.

The compiler then encountered an error attempting to test zlib:

```auto

REPORT: 
MRtrix build type requested:

REPORT: release

REPORT: 

REPORT: Detecting OS: windows

REPORT: Checking for C++11 compliant compiler [g++]:
EXEC <<
CMD: g++ -dumpversion
EXIT: 0
STDOUT:
5.3.0
>>

REPORT: 5.3.0

COMPILE /tmp/tmpki_bodgh.cpp:
---

struct Base {
    Base (int);
};
struct Derived : Base {
    using Base::Base;
};

int main() {
  Derived D (int); // check for contructor inheritance
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -DMRTRIX_WINDOWS -mms-bitfields -Wa,-mbig-obj -march=native /tmp/tmpki_bodgh.cpp -o /tmp/tmpki_bodgh.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpki_bodgh.o -pthread -Wl,--allow-multiple-definition -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>

REPORT: - tested ok

REPORT: Detecting pointer size:

COMPILE /tmp/tmpussq0924.cpp:
---

#include <iostream>
int main() {
  std::cout << sizeof(void*);
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -DMRTRIX_WINDOWS -mms-bitfields -Wa,-mbig-obj -march=native /tmp/tmpussq0924.cpp -o /tmp/tmpussq0924.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmpussq0924.o -pthread -Wl,--allow-multiple-definition -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
STDOUT:
8
>>

REPORT: 64 bit

REPORT: Detecting byte order:

REPORT: little-endian

REPORT: Checking for variable-length array support:

COMPILE /tmp/tmp95sdma1g.cpp:
---

int main(int argc, char* argv[]) {
  int x[argc];
  return 0;
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -DMRTRIX_WINDOWS -mms-bitfields -Wa,-mbig-obj -march=native -DMRTRIX_WORD64 /tmp/tmp95sdma1g.cpp -o /tmp/tmp95sdma1g.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmp95sdma1g.o -pthread -Wl,--allow-multiple-definition -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>

REPORT: yes

REPORT: Checking for non-POD variable-length array support:

COMPILE /tmp/tmp4umbpvnm.cpp:
---

#include <string>

class X {
  int x;
  double y;
  std::string s;
};

int main(int argc, char* argv[]) {
  X x[argc];
  return 0;
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -DMRTRIX_WINDOWS -mms-bitfields -Wa,-mbig-obj -march=native -DMRTRIX_WORD64 /tmp/tmp4umbpvnm.cpp -o /tmp/tmp4umbpvnm.o
EXIT: 0
>>

EXEC <<
CMD: g++ /tmp/tmp4umbpvnm.o -pthread -Wl,--allow-multiple-definition -o a.out
EXIT: 0
>>

EXEC <<
CMD: ./a.out
EXIT: 0
>>

REPORT: yes

REPORT: Checking for zlib compression library:

COMPILE /tmp/tmprk8n4biu.cpp:
---

#include <iostream>
#include <zlib.h>

int main() {
  std::cout << zlibVersion();
  return (0);
}

---
EXEC <<
CMD: g++ -c -std=c++11 -pthread -DMRTRIX_WINDOWS -mms-bitfields -Wa,-mbig-obj -march=native -DMRTRIX_WORD64 /tmp/tmprk8n4biu.cpp -o /tmp/tmprk8n4biu.o
EXIT: 1
STDERR:
/tmp/tmprk8n4biu.cpp:3:18: fatal error: zlib.h: No such file or directory
compilation terminated.
>>

error deleting temporary file "/tmp/tmprk8n4biu.o": No such file or directory
ERROR: error compiling zlib application!

  MRtrix3 was unable to compile a test program involving zlib.

  Set the ZLIB_CFLAGS environment variable to inform 'configure' of
  the flags it must provide to the compiler in order to compile
  programs that use zlib functionality; this may include the path to
  the zlib include files, as well as any required flags.
  For example:
    $ export ZLIB_CFLAGS="-isystem /usr/local/include"
    $./configure
  (amend with the actual path to the zlib include files on your system)

```

I can find a folder named zlib 1.2.8-3 in msys 64, along with a couple of other folders scattered around with zlib in the title.  
Each of these folders that I’ve looked at so far has 3 files of about 1kb each, called “desc” “files” and “mtree”, respectively.

The configure log looks (to me) like the process failed when it couldn’t find a file called “zlib.h” there is such a file in msys64/mingw64/include when I do a normal Windows file search.

Thanks again for your time on this.

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [September 21, 2016, 4:13am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/10 "2016-09-21T04:13:06Z")

</div>

There’s not a lot I can suggest over and above the prompt provided by `configure`:

```auto
MRtrix3 was unable to compile a test program involving zlib.
  Set the ZLIB_CFLAGS environment variable to inform 'configure' of
  the flags it must provide to the compiler in order to compile
  programs that use zlib functionality; this may include the path to
  the zlib include files, as well as any required flags.
  For example:
    $ export ZLIB_CFLAGS="-isystem /usr/local/include"
    $./configure
  (amend with the actual path to the zlib include files on your system)
```

So if you found a candidate file in msys64/mingw64/include, you would try:

```auto
    $ export ZLIB_CFLAGS="-isystem /mingw64/include"
    $./configure
```

(since ‘`msys64/`’ will be the root directory within the MSYS2 file system)

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [September 21, 2016, 7:01am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/11 "2016-09-21T07:01:01Z")

</div>

I’m surprised things would fall over quite so spectacularly. I still think the issue is most likely to be the specific shell/terminal that you start with. On my system, I get the same ‘compiler not found’ error if I start with either the _MSYS2_ or _MinGW Win-32_ variants. Are you sure the shortcut you use to launch your terminal invokes the `msys2_shell.cmd` with the `-mingw64` option? On my system looking into the properties of the shortcut, the _Target_ field reads `C:\msys64\msys2_shell.cmd -mingw64`, and `./configure` runs fine on that…

---

<div class="post-metadata">

**Author:** ![ThijsDhollander](https://community.mrtrix.org/user_avatar/community.mrtrix.org/thijsdhollander/32/1617_2.png) [@ThijsDhollander](https://community.mrtrix.org/u/ThijsDhollander)\
**Post date:** [September 21, 2016, 7:31am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/12 "2016-09-21T07:31:19Z")

</div>

I also still remember installing MSYS2 very recently, and I can not stress enough you have to be **super** careful about following the [instructions](http://msys2.github.io/) very, very carefully. At some points, you will have to close the terminal specifically before letting something continue, etc… and _change_ the shortcuts to the terminals as well. To make matters even more challenging, I noticed not everything goes _exactly_ as mentioned on that web page; so you have to combine those instructions with occasional extra instructions that actually appear on the terminal as you go. I’m not sure what happens if any specific step fails; but if (you suspect) it has, I reckon you’re better off uninstalling the whole everything and carefully trying all over again… 😓

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [September 21, 2016, 8:03am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/13 "2016-09-21T08:03:32Z")

</div>

Yes, I have to agree, getting MSYS2 installed has turned into a bit of a mess. It used to be pretty straightforward, but they’ve obviously made changes that make it really fiddly to update without breaking the entire system. I was hoping they’d release an updated installer to avoid users having to jump through all these hoops, but nothing’s happened so far… Maybe this is something we could try to fix up? Could we provide an up to date version of MSYS2…?

---

<div class="post-metadata">

**Author:** ![tplillicrap](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tplillicrap](https://community.mrtrix.org/u/tplillicrap)\
**Post date:** [September 22, 2016, 4:14am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/14 "2016-09-22T04:14:44Z")

</div>

Thanks for all the advice.  
I’ve tried pointing the ZLIB\_CFLAGS variable to every possible candidate I could find and each time the result is identical.

With regard to the shortcut, it was missing the -mingw64 (the target just read “C:\msys64\msys2\_shell.cmd”) but even after fixing this I seem to be having a very similar problem.

I think I will try uninstalling the whole lot and starting again.

Thanks again for your help.

---

<div class="post-metadata">

**Author:** ![Omar\_Narvaez](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/o/779978/32.png) [@Omar\_Narvaez](https://community.mrtrix.org/u/Omar_Narvaez)\
**Post date:** [October 11, 2017, 4:59am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/15 "2017-10-11T04:59:50Z")

</div>

Hi!  
I have the same problem with the Eigen3 and I’ve already tried to reinstall and nothing.

```auto
MRtrix3 was unable to compile a test program involving Eigen3.
  Set the EIGEN_CFLAGS environment variable to inform 'configure' of
  the flags it must provide to the compiler in order to compile
  programs that use Eigen3 functionality; this may include the path to
  the zlib include files, as well as any required flags.
  For example:
    $ export EIGEN_CFLAGS="-isystem /usr/include/eigen3"
    $./configure
  (amend with the actual path to the Eigen3 include files on your system)

```

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [October 11, 2017, 7:11am UTC](https://community.mrtrix.org/t/error-relating-to-c-compiler-when-running-configure-on-windows/454/16 "2017-10-11T07:11:05Z")

</div>

OK, it does look like there are issues with recent versions of MSYS2, as reported in [this post](https://community.mrtrix.org/t/configure-and-build-fails-on-windows-install/323/4?u=jdtournier) and [this one](https://community.mrtrix.org/t/error-error-compiling-eigen3-application/1215?u=jdtournier)… Can I ask you to try the following:

- bring your MSYS2 installation up to date ([instructions here](https://github.com/msys2/msys2/wiki/MSYS2-installation#iii-updating-packages))

- bring your _MRtrix3_ installation up to date:

- try running `configure` & `build` using the MSYS2 version of `python` (rather than the MinGW version):

If that still doesn’t work, please post your `configure.log` file - it might give us a hint as to where the problem might be…
