12

I am receiving the following error when I try to compile a very basic C++ program.

$ g++ -fuse-linker-plugin test.cpp
g++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.

Code

int main() {
        return 0;
}

This is using G++ installed straight out of a fresh Cygwin installation.

If I search for the file there, it does exist and is located at:

/usr/libexec/gcc/x86_64-pc-cygwin/4.8.2/cyglto_plugin.dll

How do I make Cygwin 64 look at this correctly?

4 Answers 4

10

I guess you only checked the gcc-g++ package at installation. Note that the version is 4.8.1-3 BUT on the next page you can see a lot of dependencies being installed, for example libgcc with version 4.8.2.

That mix of 4.8.1 and 4.8.2 seems to be the problem.

In the installer, copy all dependencies into an editor, search for 4.8.2 to find the problematic packages, go back in the installer and click those packages until 4.8.1-3 will be installed.

Double check you're not installing the latest version of those packages.

1
  • That was the exact problem and it fixed my issue. Cheers!! Guess I need to wait for all packages to be updated, before letting them all upgrade.
    – Michael
    Commented Oct 30, 2013 at 22:17
5

More recently using apt-cyg, g++ 4.9.2 was installed but gcc-core 4.8.2 remained.

Resolved by:

    apt-cyg remove gcc-g++
    apt-cyg remove gcc-core
    apt-cyg install gcc-g++
1

Two version of gcc was causing proble, check folder /usr/libexec/gcc/x86_64-pc-cygwin/ there would be two version of gcc. To solve remove one.

0

The above answer worked for me, but I got caught by the installer automatically upgrading packages back to 4.8.2. So, I initially thought this didn't work; it actually did. You just need to be aware of that when using the installer to add packages later, it may try to upgrade back to 4.8.2 again and break things.

There is the option to turn off LTO with -fno-use-linker-plugin, but that doesn't do me any good becuase CPAN is what is launching g++. It might serve as a workaround.

(I know this isn't much of an answer, but I was unable to comment)

1
  • In the "Select Packages" window click "Keep" instead of "Curr" to not upgrade all packages automatically.
    – xnor
    Commented Nov 4, 2013 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.