Code::Blocks

User forums => Help => Topic started by: 37712 on June 14, 2018, 02:38:00 am

Title: error unrecognized option '-plugin'
Post by: 37712 on June 14, 2018, 02:38:00 am
Hi, I installed code blocks IDE and everything was running without a problem until yesterday. when ever I try to compile my c code I get an error message.

this is my build messages:

=== Build: Release in LinkedList (compiler: GNU GCC Compiler) ===
ld.exe    unrecognized option '-plugin'
             error: ld returned 1 exit status
=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===


this is my build log:

-------------- Clean: Release in LinkedListAssignment (compiler: GNU GCC Compiler)---------------

Cleaned "LinkedListAssignment - Release"

-------------- Build: Release in LinkedListAssignment (compiler: GNU GCC Compiler)---------------

mingw32-gcc.exe -Wall -std=c99 -O2 -std=c99  -c "C:\Users\37712\Google Drive\C Projects\CodeBlocks Projects\LinkedListAssignment\LinkedListAssignment.c" -o obj\Release\LinkedListAssignment.o
mingw32-g++.exe  -o bin\Release\LinkedListAssignment.exe obj\Release\LinkedListAssignment.o  -s 
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: unrecognized option '-plugin'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

I am no sure but I think the problem started when I clicked on the CppCheck in the plugin which also gave me some kind of error message about failure to launch. please help I don't know what to do =(

I am using windows 7
Title: Re: error unrecognized option '-plugin'
Post by: stahta01 on June 14, 2018, 04:32:43 am
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)

Edit: The above link gets you close to the linker settings that need checked.

Remove the option that was added in error.

Likely in other linker settings might be called extra linker settings.

Tim S.
Title: Re: error unrecognized option '-plugin'
Post by: 37712 on June 14, 2018, 05:17:32 am
hello, I followed your link and did the instructions about "compile a project using some non-standard libraries" that you sent me but I don't have any instructions there to modify I simply have a blank page to add instructions not modify, I have pretty much a clean install of code blocks and I still haven't been able to fix the problem. global compiler setting>search directories is all empty.
Title: Re: error unrecognized option '-plugin'
Post by: oBFusCATed on June 14, 2018, 07:36:17 am
Can you post the full rebuild log?
Title: Re: error unrecognized option '-plugin'
Post by: 37712 on June 14, 2018, 08:21:09 am
not sure what u mean by rebuild log, I assume you mean to rebuild the code/project and post the build log so here it is:

-------------- Clean: Release in LinkedListAssignment (compiler: GNU GCC Compiler)---------------

Cleaned "LinkedListAssignment - Release"

-------------- Build: Release in LinkedListAssignment (compiler: GNU GCC Compiler)---------------

mingw32-gcc.exe -Wall -std=c99 -O2 -std=c99  -c "C:\Users\37712\Google Drive\C Projects\CodeBlocks Projects\LinkedListAssignment\LinkedListAssignment.c" -o obj\Release\LinkedListAssignment.o
mingw32-g++.exe  -o bin\Release\LinkedListAssignment.exe obj\Release\LinkedListAssignment.o  -s 
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: unrecognized option '-plugin'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
Title: Re: error unrecognized option '-plugin'
Post by: Miguel Gimenez on June 14, 2018, 10:16:16 am
-plugin is a valid option for ld.exe starting with gcc 4.5.0, and in this case is passed by mngw32-g++. It seems the ld.exe version and mingw32-g++.exe one don't match. Do you have two installations of mingw?

Can you post the output of the following command (executed in CMD)?

Code: [Select]
mingw32-g++ -Xlinker -v
Title: Re: error unrecognized option '-plugin'
Post by: 37712 on June 14, 2018, 10:53:02 am
I don't think I have MinGW installed twice but i do have Cygwin installed, i dont know if that would be the reason.

here is the cmd code u asked me to run:

C:\Users\37712>mingw32-g++ -Xlinker -v
collect2 version 6.3.0
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe -plugin c:/mingw/bin/../libexec
/gcc/mingw32/6.3.0/liblto_plugin-0.dll -plugin-opt=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wra
pper.exe -plugin-opt=-fresolution=C:\Users\37712\AppData\Local\Temp\ccS4fIgE.res -plugin-opt=-pass-t
hrough=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass
-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-o
pt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -
plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-l
gcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through
=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -Bdynamic -u ___register_frame_info -u ___deregister_f
rame_info c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/6.3.
0/crtbegin.o -Lc:/mingw/bin/../lib/gcc/mingw32/6.3.0 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib
/gcc/mingw32/6.3.0/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../.. -v -lstd
c++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -
lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/6.3.0/crtend.o
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: unrecognized option '-plugin'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: use the --help option for usag
e information
collect2.exe: error: ld returned 1 exit status

C:\Users\37712>
Title: Re: error unrecognized option '-plugin'
Post by: 37712 on June 14, 2018, 11:28:27 am
*** PROBLEM RESOLVED ***

apparently it was a problem with my MinGW installation but I don't know what it was. I ended up completely uninstalling and reinstalling MinGW and that somehow fixed the problem.