Nafiul Islam
Nafiul Islam

Reputation: 82480

Installing Haskell Platform overrides gcc location in system PATH

I am running the latest version of MinGW GCC 4.7.2, and it was working fine with -std=c++11 before I installed Haskell using Haskell Platform. Please take a look at this:

enter image description here

For some reason, the GCC went back to 4.5.2, after installing Haskell, I re-installed it, with version 4.7.2, but its still showing 4.5.2.

Upvotes: 1

Views: 597

Answers (1)

rubenvb
rubenvb

Reputation: 76579

Haskell adds its own GCC to your system PATH. You can check this is true by running

where gcc

which will show two commands, the Haskell one first, followed by your MinGW GCC.

The solution is to change your PATH to point to the GCC you want (but make sure Haskell still uses its GCC, I doubt it'll agree with GCC 4.7 if it came with GCC 4.5).

The easiest is to have some script ou can run to set up your compilation environment, so you don't have to worry about system PATHs.

If you don't care much about that exact GCC version you had installed, you can get my builds (32-bit and 64-bit), which come with a .cmd file you can doubleclick and it will give you a build environment much like the MSVS commandline shortcut, but for GCC. All it really does is add the compilers to PATH.

Upvotes: 4

Related Questions