Ecere SDK/eC Forums
https://ecere.org/community/
Print view

Cross-compiling in Debian / Ubuntu
https://ecere.org/community/viewtopic.php?f=2&t=94
Page 1 of 1
Author:  redj [ Mon Aug 23, 2010 3:20 pm ]
Post subject:  Cross-compiling in Debian / Ubuntu

Now for the cross-compiler stuff.

This is bleeding edge stuff for now so make sure you have the latest tarball. I think the next pre-release will include all this out of the box but if not, at the very least this procedure will work.

Make sure you have a good installation of the SDK (Build & Install SDK in Debian / Ubuntu + 64bit) but use the latest (post with download link) tarball.

Just the commands:

Code: Select all

sudo apt-get install mingw32
sudo apt-get wine
wine cmd
exit
wget http://ecere.com/downloads/winbin.zip
unzip -x winbin.zip
mv bin/ecere*.dll /home/user/.wine/drive_c/windows/system32/
Steps:

1. You need to install the mingw32 compiler.

Code: Select all

sudo apt-get install mingw32
2. If you want to run the programs you compile with this able compiler, you might want to install wine and go through a quick configuration by running cmd. (Exit command prompt afterwards.)

Code: Select all

sudo apt-get install wine
wine cmd
exit
3. You need windows binaries in-place to easily link and run windows binaries. (Remember to replace /home/user to match your username.)

Code: Select all

wget http://ecere.com/downloads/winbin.zip
unzip -x winbin.zip
mv bin/ecere*.dll /home/user/.wine/drive_c/windows/system32/
4. This new compiler could use a configuration in the IDE.
  • a. Applications -> Programming -> Ecere IDE
    b. File -> Global Settings
    c. Compilers
    d. Duplicate the default compiler
    e. Name it mingw32
    e. In Toolchain
    • e.1. replace cpp by i586-mingw32msvc-cpp
      e.2. replace gcc by i586-mingw32msvc-gcc
    f. In Libraries, Add the following directories (Remember to change /home/user to match your username.) (The order is important here.)

    Code: Select all

    /usr/i586-mingw32msvc/lib
    /home/user/.wine/drive_c/windows/system32
    g. Ok
5. Let's try this new compiler.
  • a. Open a sample. (Project -> Open / CTRL+SHIFT+O)
    b. Select the mingw32 compiler. (Project -> Active Compiler)
    c. Build the sample! (Project -> Build / F7)
    d. Test this new windows executable.

    Code: Select all

    wine obj/helloWorld.debug.mingw32.win32/HelloWorld.exe
    wine obj/helloForm.debug.mingw32.win32/HelloForm.exe
That's it for now!

-redj

PS: This has been tested in Debian 5.0 and Ubuntu 9.10 / 10.04 (both 32 and 64 bit).
(with 64 bit linux, produced windows binaries are 32 bit)
PS: Feedback for all platforms is welcome.
All times are UTC-05:00 Page 1 of 1