News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Using MingW with Code::Blocks in Ubuntu

Started by TnTonly, March 22, 2009, 03:21:38 AM

Previous topic - Next topic

TnTonly

I have googled everywhere but still didn't find any solution. Please help!

I am using Ubuntu 8.10, installing MinGW by using Synaptic, search for mingw and check both 3 of them

Then I config Code::Blocks exactly like this tutorial
http://wiki.codeblocks.org/index.php?title=Code::Blocks_and_Cross_Compilers

But when I compiling any HelloWorld, I just got a message "uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]." and "Nothing to be done".

Thanks in advance!

Jenna

That means the toolchain for the compiler you have chosen for your project is incorrect.

Make sure you chose the correct compilername for the target you want to cross-compile.
Check the text box containing the compilers installation directory (master-path), the bin-part should not be included.

ATTENTION:
If you use the MinGW installed via synaptic the master-path most likely differs from the one in the wiki article.
The cross compilers (at least on debian-based systems) are installed in /usr/bin, only the libs and includes are in /usr/i586-mingw32msvc/.
(See also this article: http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux#Preparing_Code::Blocks .

Check the naming of your executables.

Try to call them from commandline:
<master-path>/bin/<C++-compiler> -v

in my case (for c++-compiler):

jens@debian-inspiron:~$ /usr/bin/i586-mingw32msvc-g++ -v
Using built-in specs.
Target: i586-mingw32msvc
Configured with: /home/ron/devel/debian/mingw32/mingw32-4.2.1.dfsg/build_dir/src/gcc-4.2.1-2-dfsg/configure -v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++ --enable-threads --enable-sjlj-exceptions --disable-multilib --enable-version-specific-runtime-libs
Thread model: win32
gcc version 4.2.1-sjlj (mingw32-2)

TnTonly

Well, this articles is pretty long for now, and when I came back, I was surprise I didn't thank you that time. It solved the problem.

But I can see not only I encountered this problem, because the guide in Code::Blocks wiki is incorrect (or not very correct) since it says the cross-compiler is installed in /usr/i586-mingw32msvc/bin but not /usr/bin (again, at least in debian system). So I think someone should edit this guide a little to be more precisely
http://wiki.codeblocks.org/index.php?title=Code::Blocks_and_Cross_Compilers

And, thank you again. I should tell you that few months ago ^^

MortenMacFly

Quote from: TnTonly on May 15, 2009, 12:24:14 AM
So I think someone should edit this guide a little to be more precisely
http://wiki.codeblocks.org/index.php?title=Code::Blocks_and_Cross_Compilers
You know how a WiKi works, don't you?  You can add this information yourself. This would be of help for all of us.
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]