Code::Blocks Forums

User forums => Help => Topic started by: CTMacUser on April 13, 2013, 08:42:55 am

Title: Got an error at the last part of the "Creating a new project" tutorial.
Post by: CTMacUser on April 13, 2013, 08:42:55 am
I have a 32-bit Vista laptop that I upgraded to Windows 8.  I've downloaded C::B 12.11 w/ TDM-GCC 4.7.1.  I'm trying out the page at http://wiki.codeblocks.org/index.php?title=Creating_a_new_project (http://wiki.codeblocks.org/index.php?title=Creating_a_new_project).  Everything works except the last part of the last section.  Compiling with the "Release Small" doesn't work.  I get:

Quote

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

mingw32-g++.exe -Wall -fexceptions  -O2     -c C:\Users\Daryle\Documents\Projects\HelloWorld\hello.cpp -o obj\Release\hello.o
mingw32-g++.exe -Wall -fexceptions  -O2     -c C:\Users\Daryle\Documents\Projects\HelloWorld\main.cpp -o obj\Release\main.o
mingw32-g++.exe  -o bin\Release\HelloWorld.exe obj\Release\hello.o obj\Release\main.o   -s 
Output size is 467.00 KB

-------------- Build: Release Small in HelloWorld (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions  -Os  -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -flto     -c C:\Users\Daryle\Documents\Projects\HelloWorld\hello.cpp -o obj\ReleaseSmall\hello.o
mingw32-g++.exe -Wall -fexceptions  -Os  -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -flto     -c C:\Users\Daryle\Documents\Projects\HelloWorld\main.cpp -o obj\ReleaseSmall\main.o
mingw32-g++.exe  -o bin\ReleaseSmall\HelloWorld.exe obj\ReleaseSmall\hello.o obj\ReleaseSmall\main.o   -s -flto -Os -Wl,--gc-sections -shared-libgcc -shared-libstdc++ 
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: c:/program: error loading plugin
collect2.exe: error: ld returned 1 exit status
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: c:/program: error in plugin cleanup (ignored)
Process terminated with status 1 (0 minutes, 2 seconds)
0 errors, 0 warnings (0 minutes, 2 seconds)
 

I only guess is that the compiler and linker correspondences for the "small" settings have changed since the tutorial was written (or I typed something wrong).  Any ideas?...

Daryle W.
Title: Re: Got an error at the last part of the "Creating a new project" tutorial.
Post by: stahta01 on April 13, 2013, 07:47:38 pm
It works for me on Windows 7 32 bit.

I am guessing a Windows 8 security gotcha as happen in Windows Vista.

Tim S.

Code
mingw32-g++.exe -Wall -fexceptions  -Os  -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -flto  -Wmissing-include-dirs    -c V:\SourceCode\CBProjects\Wiki\Creating_a_new_project\HelloWorld\hello.cpp -o obj\ReleaseSmall\hello.o
mingw32-g++.exe -Wall -fexceptions  -Os  -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -flto  -Wmissing-include-dirs    -c V:\SourceCode\CBProjects\Wiki\Creating_a_new_project\HelloWorld\main.cpp -o obj\ReleaseSmall\main.o
mingw32-g++.exe  -o bin\ReleaseSmall\HelloWorld.exe obj\ReleaseSmall\hello.o obj\ReleaseSmall\main.o   -s -flto -Os -Wl,--gc-sections -shared-libgcc -shared-libstdc++  
Output size is 9.50 KB
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings (0 minutes, 2 seconds)
Title: Re: Got an error at the last part of the "Creating a new project" tutorial.
Post by: stahta01 on April 13, 2013, 07:53:01 pm
Oops, duplicated the error. Some reason CB and MinGW is not working if there is a space in the path to MinGW.

Edit: This almost has to be a MinGW GCC error; not sure, likely TDM is the place to first report it.
(Could be bin tools instead of MinGW GCC)

Tim S.

This happens when I use a tool-chain path of "C:\Program Files\CodeBlocks_12_11\MinGW".
My prior test used the same version of MinGW without a space in the path.

Code
-------------- Build: Release Small in HelloWorld (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions  -Os  -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -flto  -Wmissing-include-dirs    -c V:\SourceCode\CBProjects\Wiki\Creating_a_new_project\HelloWorld\hello.cpp -o obj\ReleaseSmall\hello.o
mingw32-g++.exe -Wall -fexceptions  -Os  -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -flto  -Wmissing-include-dirs    -c V:\SourceCode\CBProjects\Wiki\Creating_a_new_project\HelloWorld\main.cpp -o obj\ReleaseSmall\main.o
mingw32-g++.exe  -o bin\ReleaseSmall\HelloWorld.exe obj\ReleaseSmall\hello.o obj\ReleaseSmall\main.o   -s -flto -Os -Wl,--gc-sections -shared-libgcc -shared-libstdc++  
c:/program files/codeblocks_12_11/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: c:/program: error loading plugin
collect2.exe: error: ld returned 1 exit status
c:/program files/codeblocks_12_11/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: c:/program: error in plugin cleanup (ignored)
Process terminated with status 1 (0 minutes, 28 seconds)
1 errors, 0 warnings (0 minutes, 28 seconds)
Title: Re: Got an error at the last part of the "Creating a new project" tutorial.
Post by: stahta01 on April 13, 2013, 08:02:26 pm
Known bug remove lto (-flto) from both Compiler and Linker other options as work around.

Quote
[Bug lto/50293] New: -flto fails if GCC is installed in directory with space in path name

http://gcc.1065356.n5.nabble.com/Bug-lto-50293-New-flto-fails-if-GCC-is-installed-in-directory-with-space-in-path-name-td342805.html (http://gcc.1065356.n5.nabble.com/Bug-lto-50293-New-flto-fails-if-GCC-is-installed-in-directory-with-space-in-path-name-td342805.html)


Tim S.

Title: Re: Got an error at the last part of the "Creating a new project" tutorial.
Post by: CTMacUser on April 14, 2013, 07:28:37 am
Known bug remove lto (-flto) from both Compiler and Linker other options as work around.

Quote
[Bug lto/50293] New: -flto fails if GCC is installed in directory with space in path name

http://gcc.1065356.n5.nabble.com/Bug-lto-50293-New-flto-fails-if-GCC-is-installed-in-directory-with-space-in-path-name-td342805.html (http://gcc.1065356.n5.nabble.com/Bug-lto-50293-New-flto-fails-if-GCC-is-installed-in-directory-with-space-in-path-name-td342805.html)


Tim S.

Removing the "flto" options makes it work.  Thank you.

Daryle W.