public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* malloc undefined cross compiling with gcc 3.4.3 for mingw32
@ 2005-05-24  1:59 Mr E_T
  2005-05-24 14:09 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Mr E_T @ 2005-05-24  1:59 UTC (permalink / raw)
  To: gcc-help

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 -
( Compiles perfectly with wxgtk under linux with same toolchain version )
No matter what I do what options I use to compile the cross compiler or wxwidgets 
I get the same problem.

 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)
  
 (Extraneous warning filtered)
 
 My problem is the malloc thing.
 
 Any help would be appreciated.
 
 Thanx
-- 
regs MR E_T
_______________________
\                      \
  \   OOHH I hate TYPOS  \
    \                      \
      ~~~~~~~~~~~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: malloc undefined cross compiling with gcc 3.4.3 for mingw32
  2005-05-24  1:59 malloc undefined cross compiling with gcc 3.4.3 for mingw32 Mr E_T
@ 2005-05-24 14:09 ` Ian Lance Taylor
  2005-05-24 17:03   ` Mr E_T
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2005-05-24 14:09 UTC (permalink / raw)
  To: Mr E_T; +Cc: gcc-help

Mr E_T <troll@arach.net.au> writes:

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

<cstdlib> includes <stdlib.h>.  <stdlib.h> is supposed to declare
malloc.  Apparently, it doesn't, and that is what the compiler is
complaining about.

This is not a compiler bug, unless there really is a declaration of
malloc and the compiler is somehow ignoring it.  This is a library bug
of some sort.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: malloc undefined cross compiling with gcc 3.4.3 for mingw32
  2005-05-24 14:09 ` Ian Lance Taylor
@ 2005-05-24 17:03   ` Mr E_T
  0 siblings, 0 replies; 3+ messages in thread
From: Mr E_T @ 2005-05-24 17:03 UTC (permalink / raw)
  To: gcc-help

On Tuesday 24 May 2005 22:09, Ian Lance Taylor wrote:
> Mr E_T <troll@arach.net.au> writes:
> 
> >  /opt/compilers/lib/gcc/i486-mingw32/3.4.3/../../../../include/c++/3.4.3/cstdlib:103: error: `::malloc' has not been declared
> 
> <cstdlib> includes <stdlib.h>.  <stdlib.h> is supposed to declare
> malloc.  Apparently, it doesn't, and that is what the compiler is
> complaining about.
> 
> This is not a compiler bug, unless there really is a declaration of
> malloc and the compiler is somehow ignoring it.  This is a library bug
> of some sort.
Actually cstdlib undefines malloc and realloc in favour of std::malloc std::realloc

Then it cant find the std:: functions.

I am having a similar problem compiling a cross gcc for uclibc with thier patches.
but with snprintf instead. ( same std::snprintf member not existing thing )

Part of my problem I have found is that gcc will ignore certain error while building - 
thus hiding the fact that they occured. (libstdc++)

I am beginning to think that I have a problem that is being passed on from my previous 
compiler. But I dont see how.

I cant even build gcc-4.0.0 without errors at the moment. - It cant find existing files.


-- 
regs MR E_T
_______________________
\                      \
  \   OOHH I hate TYPOS  \
    \                      \
      ~~~~~~~~~~~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-24 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-24  1:59 malloc undefined cross compiling with gcc 3.4.3 for mingw32 Mr E_T
2005-05-24 14:09 ` Ian Lance Taylor
2005-05-24 17:03   ` Mr E_T

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).