g++: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found

Viewed 10028

i am the beginner of mingw. pls answer my question some expert. I did the following processes:

  • i have installed mingw-get-setup.exe for C++ compiler
  • i have also used Eclipse-cpp-europa-winter-win32 for C++ IDE
  • i have also used the following uer environmental variables:
  • "<"installation-directory">"\bin;
  • "<"installation-directory">"\MSYS\1.0\local\bin;
  • "<"installation-directory">"\MSYS\1.0\bin

But i have "launch failed no binaries" error when i run my program. I have built the program before run. I have also get the following error in console:

  • Build of configuration Debug for project test **
  • Internal Builder is used for build** **
  • g++ -otest.exe test.o
  • g++: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found
  • compilation terminated.
  • Build error occurred, build is stopped
  • Time consumed: 78 ms.**
3 Answers

What I encountered is: when installing MingW32, by default, it only install "gcc". So in the system, g++ is still the GNU version, so it cannot find MingW32 liblto_plugin-0.dll. I guess the g++ running in your environment is not the one you intend to use.

$ which gcc
/MinGW/bin/gcc

$ which g++
/usr/bin/g++

$ gcc --version
gcc.exe (MinGW.org GCC-8.2.0-5) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ --version
g++.exe (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Related