strange error message by GCC on Windows platform

After having installed a second version of the GCC suite on the MS-Windows platform of my PC, it turned out to be impossible to use the gfortran front end of the older one. I had downloaded both editions from the equation.com web page.

When trying to link a program using the older gcc/gfortran version, I always got an error message that looked like “fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found”. Unfortunately, even a very extensive web search did not help. As I had not changed the position of the old files in the directory tree, it must have been the installation routine that created that mess. Indeed, the problem turned out to be caused by the installation routine adding the paths to two directories of the newer gcc version at the beginning of two environment variables, i.e., the user variable EQ_LIBRARY_PATH, and the system variable PATH. Because the name of the file is still the same in the newer version, the older gcc suite detects a wrong version of that file and raises the error message. Obviously, the error message should rather read “gcc found a wrong version of …”.

Thus, the cure to the problem is to edit these two environment variables manually. After having saved their proper content to text files by typing “set > set.txt” and “path > path.txt” on the command line, e.g., erase all information related to the gcc versions from both variables. In order to change PATH permanently, you need to have admin privileges. After that, just use a batch file on the command line to set the content of both variables according to the version of gcc that you are going to use in that very session of the command interpreter and all is fine. At least, that’s how it worked for me.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s