aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Cross compile aMule 2.0.1 for win32 with mingw32  (Read 3031 times)

troll

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 4
Cross compile aMule 2.0.1 for win32 with mingw32
« on: May 22, 2005, 08:32:28 AM »

I have installed the cross toolchain with -



binutils 2.15.94.0.2
  configure --prefix=/opt/compilers --host=i486-pc-linux-gnu \
      --build=i486-pc-linux-gnu --target=i486-mingw32 --infodir=/tmp \
      --mandir=/tmp --datadir=$PREFIX/i486-mingw32/share
  make
  make gnulocaledir=/tmp localedir=/tmp install

gcc 3.4.3
  configure --prefix=/opt/compilers -host=i486-pc-linux-gnu \
      --build=i486-pc-linux-gnu --target=i486-mingw32 --infodir=/tmp \
      --enable-threads=win32 \
      --mandir=/tmp --datadir=$PREFIX/i486-mingw32/share
  make
  make -C gnatlib
  make gnulocaledir=/tmp localedir=/tmp install

w32api 3.2
  configure --prefix=/opt/compilers/i486-mingw32 --build=i486-pc-linux-gnu \
      --host=i486-mingw32 --target=i486-mingw32
  make
  make install

mingw-runtime 3.7
  configure --prefix=/opt/compilers/i486-mingw32 \
    --build=i486-pc-linux-gnu --host=i486-mingw32 --target=i486-mingw32
  make
  make install

wxWidgets 2.6.0
  configure --prefix=/opt/compilers/i486-mingw32 --mandir=/tmp --infodir=/tmp \
    --build=i486-pc-linux-gnu --host=i486-mingw32--enable-optimise \
    --with-libpng --with-libjpeg --with-libtiff \
    --with-zlib --without-sdl --enable-odbc --disable-monolithic --enable-threads
  make
  make install
  mv /opt/compilers/i486-mingw32/lib/wx*.dll /opt/compilers/i486-mingw32/bin

Everything worked well including the other libraries - zlib, jpeg etc.

I then tried aMule 2.0.1
  configure --host=i486-mingw32 --enable-amule-gui --enable-amulecmd \
    --enable-amulecmdgui --enable-amule-daemon --enable-webserver \
    --enable-webservergui --enable-alc --enable-alcc --enable-cas --enable-wxcas \
    --with-wx-prefix=/opt/compilers/i486-mingw32
  make
and got the following fatal errors ( in a number of files ) -
if i486-mingw32-g++ -DHAVE_CONFIG_H -I. -I. -I..   -I/opt/comilers/i486-mingw32/include -I/opt/compilers/i486-mingw32/lib/wx/include/i486-mingw32-msw-ansi-release-2.6 -I/opt/compilers/i486-mingw32/include/wx-2.6 -D__WXMSW__ -mthreads -DWXUSINGDLL=1 -DNO_GCC_PRAGMA   -DwxUSE_GUI=0 -I/usr/include/libpng12   -DEC_REMOTE -DWEBSERVERDIR="\"/usr/share/amule/webserver\"" -I/opt/comilers/i486-mingw32/include -DUSE_EMBEDDED_CRYPTO -W -Wall -g -ggdb -fno-inline -D__DEBUG__ -fmessage-length=0   -MT amuleweb-WebServer.o -MD -MP -MF ".deps/amuleweb-WebServer.Tpo" -c-o amuleweb-WebServer.o `test -f 'WebServer.cpp' || echo './'`WebServer.cpp; \
.
.
.
/opt/compilers/lib/gcc/i486-mingw32/3.4.3/../../../../include/c++/3.4.3/cstdlib:103: error: `::malloc' has not been declared
/opt/compilers/lib/gcc/i486-mingw32/3.4.3/../../../../include/c++/3.4.3/cstdlib:111: error: `::realloc' has not been declared
/opt/compilers/i486-mingw32/include/wx-2.6/wx/buffer.h:96: error: `malloc' undeclared (first use this function)
/opt/compilers/i486-mingw32/include/wx-2.6/wx/buffer.h:96: error: (Each undeclared identifier is reported only once for each function it appears in.)
/opt/compilers/i486-mingw32/include/wx-2.6/wx/buffer.h:100: error: `malloc' undeclared (first use this function)
/opt/compilers/i486-mingw32/include/wx-2.6/wx/buffer.h:134: error: `malloc' undeclared (first use this function)
/opt/compilers/i486-mingw32/include/wx-2.6/wx/buffer.h:145: error: `realloc' undeclared (first use this function)
 X(
(Extraneous warning filtered)

My problem is the malloc thing.

Any help would be appreciated.

Thanx
 :baby:
« Last Edit: May 22, 2005, 08:33:23 AM by troll »
Logged

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: Cross compile aMule 2.0.1 for win32 with mingw32
« Reply #1 on: May 22, 2005, 08:39:43 AM »

well I compiled wx-2.6 under winXP with

./configure --without-checklistbox --disable-shared --disable-compat22 --disable-wave --disable-fraction --disable-mdi --disable-joystick

and worked just fine...
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

troll

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 4
Re: Cross compile aMule 2.0.1 for win32 with mingw32
« Reply #2 on: May 22, 2005, 08:49:26 AM »

Yeah - but after viewing previous posts - they all seemed to cause problems at the link stage - not compile.

Its this damn undefined malloc thats causing me grief.

If I could get past that I could figure out the rest.

alc.exe alcc.exe cas.exe wxcas.exe and ed2k.exe compile just fine.
 ?(
Logged

TripleM

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
RE: Cross compile aMule 2.0.1 for win32 with mingw32
« Reply #3 on: August 01, 2005, 05:24:05 AM »

Quote
/opt/compilers/lib/gcc/i486-mingw32/3.4.3/../../../../include/c++/3.4.3/cstdlib:103: error: `::malloc' has not been declared
/opt/compilers/lib/gcc/i486-mingw32/3.4.3/../../../../include/c++/3.4.3/cstdlib:111: error: `::realloc' has not been declared

i came across the same prob in my trial to crosscompile the remotegui for windows. in cstdlib it tries to redefine malloc and realloc, which doesnt seem to work. i commented out these lines in cstdlib:
Code: [Select]
#undef malloc
#undef realloc
using ::malloc;
using ::realloc;
and now it works like a charm.  :D

i hope, this helps you to solve your prob.


so long,
Logged