Compiling error: Malloc.cpp line 430

Post Reply
Krelian
Posts: 3
Joined: Wed Sep 12, 2012 8:20 pm

Compiling error: Malloc.cpp line 430

Post by Krelian » Fri Sep 14, 2012 4:45 pm

Started compiling yesterday and recieved this error:

Code: Select all

ffxi@Krelian:~/dsp$ make
g++ -std=gnu++0x -DHAVE_CONFIG_H -I. -I./src/common      -DdsUDPSERV      -g -O2 -MT dsgame-malloc.o -MD -MP -MF .deps/dsgame-malloc.Tpo -c -o dsgame-malloc.o `test -f 'src/common/malloc.cpp' || echo './'`src/common/malloc.cpp
src/common/malloc.cpp: In function âvoid _mfree(void*, const char*, int, const char*)â:
src/common/malloc.cpp:430: error: cast from âunit_head*â to âuintptrâ loses precision
src/common/malloc.cpp:430: error: cast from âchar*â to âuintptrâ loses precision
make: *** [dsgame-malloc.o] Error 1
I fear it may be my 64bit linux after reading the wiki but if anyone can shed some light on the exact cause it'd be much appreciated.

Anyone got any idea? I've compiled plenty of server emulators before and never seen anything like this.. Am I missing any libraries?

Running: Linux version 2.6.32-5-amd64 (Debian 2.6.32-45) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Sun May 6 04:00:17 UTC 2012

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Compiling error: Malloc.cpp line 430

Post by bluekirby0 » Sat Sep 15, 2012 2:39 am

src/common/malloc.cpp:430: error: cast from âunit_head*â to âuintptrâ loses precision
Things like this are indicative of trying to compile it 64-bit. I made some efforts at one point to make it compile on 64-bit linux but it still died when it came time for character creation. For now you can do a 32-bit build (you'll need the 32-bit libraries, gcc, and g++ multilib packages installed and override CFLAGS with -m32 and if you are lucky it will work).

The most sane way to do a 32-bit build on a 64-bit linux is unfortunately to use pbuilder to set up your environment and compile the libraries statically so you don't end up with an executable trying to call 64-bit shared libraries later.

Post Reply