News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

HelloWorld program failes to link

Started by Ancient Dragon, August 28, 2009, 07:23:56 PM

Previous topic - Next topic

Ancient Dragon

QuoteCompiling: main.cpp
Execution of 'g++.exe.lnk -Wall -fexceptions  -g     -c C:\dvlp\HelloWorld\main.cpp -o obj\Debug\main.o' in 'C:\dvlp\HelloWorld' failed.
Nothing to be done.

I just installed C::B with MiniGW compiler on 64-bit Vista Home Premium (I also have VC++ 2008 Express installed).  At first C::B produced error that it could not find the compiler.  I finally got that figured out, but now it produces the agove error.  I looked in the MiniGW bin folder and there is no program named "g++.exe.lnk".  Nor did it produce a *.o file from the *.cpp file.

Anyone know what is wrong?


MortenMacFly

Quote from: Ancient Dragon on August 28, 2009, 07:23:56 PM
I looked in the MiniGW bin folder and there is no program named "g++.exe.lnk".
Install the GCC / G++ compiler. Just MinGW is not enough. Follow the instructions on the MinGW webpage.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

stahta01

Quote from: Ancient Dragon on August 28, 2009, 07:23:56 PM
I just installed C::B with MiniGW compiler on 64-bit Vista Home Premium

NOTE: The MinGW GCC packaged with Code::Blocks 8.02 is not good enough for normal Vista; not idea about Home Edition.

What version of MinGW did you install?

gcc -v


Tim S.



C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Jenna

What makes me wonder is g++.exe.lnk.
It seems your g++ in the toolchain points to a link of to g++.exe not to th executable itself.

That does not work from inside C::B !!!

Ancient Dragon

Thanks for your comments.  I uninstalled C::B, installed MiniGW in c:\MiniGW (the default), then reinstalled C::B without MiniGW.  Tried to compiled Hello World c++ again, and it failed with the same problem as before.

Ok, I finally figured out the problem.  I had to go into the toolchain executables window and reset the compiler and linker to both use g++.exe instead of the default g++.exe.lnk. 

Jenna

Quote from: Ancient Dragon on August 29, 2009, 05:59:46 AM
Ok, I finally figured out the problem.  I had to go into the toolchain executables window and reset the compiler and linker to both use g++.exe instead of the default g++.exe.lnk. 

I never saw g++.exe.lnk as default value for the cpp-compiler the default value set by C::B is ming32-g++.exe .

So please don't blame C::B for a configuration error.

And I told you that most likely your toolchain is not set up correctly.
It would have been easier to check this before uninstalling and reinstalling C::B and MinGW.

Ancient Dragon

Quote from: jens on August 29, 2009, 08:58:20 AM

So please don't blame C::B for a configuration error.
Since I installed C::B with all defaults (location etc) there is no other reason for that to have happened other than faulty C::B installation program.  Oh well, its working now, so I'm not going to moan about that any more.  C::B developer team did an outstanding job writing that IDE :)

Quote from: jens on August 29, 2009, 08:58:20 AM
And I told you that most likely your toolchain is not set up correctly.
It would have been easier to check this before uninstalling and reinstalling C::B and MinGW.

Yes you are right about that one.  I had seen that several times but I thought (wrongly) that the linker would be a different program than the compiler.