User forums > Using Code::Blocks

Howto - Cross Compiling in Linux using MingW32

<< < (9/25) > >>

Ganbito:
I've reinstalled Ubuntu (for the garbage generated with manual compiling wxWidgets) and decided to give a last chance to your wxMSW.

This time I see that I have set `wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static` in Compiler settings -> Other options but don't in Linker Settings -> Other options. But there is no change, it continues to search include files in /usr/include/wx-2.8/wx/msw/ so it can't compile.

Then I compile wxWidgets with the same configure options as I write in the last post and it get to work right (after uninstall your wxMSW).

I know that wxPropertyGrid is not part of wxWidgets. I wrote:

--- Quote from: Ganbito on August 12, 2008, 02:19:29 am ---Then, I try cross compiling my own project and I get problems with wxPropertyGrid (the same which Code::Blocks use) for the cross build, but that is already another story.

--- End quote ---
only as a comment. This time I've could cross compile it with my windows release.

After that (I don't know if it is related with cross-compilation, but I get this error after setting Code-Blocks and my project for cross-compiling) I get this error building with the default Debug-target (wich I don't modify at any time):


--- Code: ---cc1plus: error: no se reconoce la opción de línea de comando "-mthreads"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

--- End code ---

Approximate translation:


--- Code: ---cc1plus: error: unknown command line option "-mthreads"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

--- End code ---

This only happens when I try to build the whole project (or Rebuild), not when building changes.

Any idea?

Jenna:
If you did not set -mthreads manually, it means that you use the "wx-config" of the cross-libs for the linux-build ("-mthreads" belongs to win, "-pthread" to linux).

Can you provide a sample project where the error occurs ?
If possible it would be nice if you can also send me your default.conf ("~/.codeblocks/default.conf").

Ganbito:
You are right.

After compiling (and installing) wxMSW, I've check the wx-config --list output and it was right.

But now, I recheck it and only obtain:


--- Code: ---   Default config is i586-mingw32msvc-msw-unicode-release-static-2.8

Default config will be used for output

--- End code ---

I don't know when it changed, but it changed.

I'm trying to solve it by making a symbolic link to the right wx-config:

--- Code: ---$ sudo ln -s /usr/lib/wx/config/gtk2-unicode-release-2.8 /usr/bin/wx-config
--- End code ---
but I obtain the same as above with wx-config --list.

In contrast, if I try /usr/lib/wx/config/gtk2-unicode-release-2.8 --list I obtain:

--- Code: ---
    Default config is gtk2-unicode-release-2.8

  Default config will be used for output

  Alternate matches:
    base-unicode-debug-2.8
    base-unicode-release-2.8
    gtk2-unicode-debug-2.8

  Also available in /usr:
    i586-mingw32msvc-msw-unicode-release-static-2.8


--- End code ---

Even if I copy it directly, I obtain the same result, I'm confused.

I will continue with it tomorrow. I think that is time to go to wxWidgets forum.

I can provide them, but I think that it is not necessary because the cause was found.

Thanks.

EDIT:
When compiling wxWidgets without --prefix it is installed in /usr/local. So when I type wx-config --list in the terminal the system uses the one which is in /usr/local/bin. The same applies when building in Code::Blocks.

So, if I want to cross-compile under linux, I should compile all wxWidgets libraries by myself (and get it to work)... It seems that I will install Code::Blocks in windows.

Jenna:
If the wx-config does not list the correct entries, it's a wxWidgets install issue.
What does
--- Code: ---update-alternatives --list wx-config
--- End code ---
show?

It should be something like:

--- Code: ---/usr/lib/wx/config/base-unicode-release-2.8
/usr/lib/wx/config/gtk2-unicode-release-2.8

--- End code ---
.
If not it might be that you did not install the exWidgets-dev packages correctly.
You can try to uninstall your self-compiled wxwidgets by running "make uninstall" from its source directory.
And then reinstall all wxWidgets-packages.

You should eventually purge them first.

From synaptic chose "remove completely", maybe it's not the exact text, but it should be something like this (my system uses german language).

Then install:
"libwxbase2.8-0", "libwxbase2.8-dev", "libwxgtk2.8-0", "libwxgtk2.8-dev", "wx2.8-headers", "wx2.8-i18n", "wx-common", "libwxmsw2.8-dev", "wx2.8-headers-msw" and if you need due to dependencies of "wx2.8-headers-msw" you have to install "wx2.8-headers-msw-force-depends".
(The debug-packages of wxWidgets are only needed if you want to debug wxWidgets itself.)

And of course you need "mingw32" and its dependencies "mingw32-binutils" and "mingw32-runtime".

That's the installation that works out of the box on all my debian systems with the setup described in my wiki-article (even on clean systems, where I never build wxWidgets or C::B from source).

Ganbito:

--- Code: ---update-alternatives --list wx-config
--- End code ---
shows:


--- Code: ---/usr/lib/wx/config/base-unicode-release-2.8
/usr/lib/wx/config/gtk2-unicode-release-2.8
/usr/lib/wx/config/base-unicode-debug-2.8
/usr/lib/wx/config/gtk2-unicode-debug-2.8

--- End code ---

I did a "make uninstall" and "remove completely" the wxWidgets libraries yesterday, but I will try another time.
....

I obtain the same.

Of course, I have installed "mingw32" and its dependencies, if don't I won't be able to cross-compile for windows, and I can.

I tried exactly your wiki-article after reinstalling (before building wxWidgets), and it don't work for me, it can be because my system is not Debian, but Debian-based (Ubuntu).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version