Undefined reference to `operator new[](unsigned)'?

Hi,

I’ve just had a user write to me saying that they cannot compile my app with
SDL 1.2.4-5 (which they installed via an RPM) for Redhat 8.0

Just trying to eliminate possibilities here… could it be they should
install an earlier version of SDL?

Has anyone else had this problem?

gcc /usr/bin/sdl-config --cflags --libs -lSDL_mixer -lSDL_image ai.o
aliens.o audio.o bullets.o cargo.o collectable.o comms.o events.o
explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o
messages.o misc.o missions.o player.o resources.o script.o shop.o
Starfighter.o title.o unpack.o weapons.o -o starfighter
aliens.o: In function addAlien()': aliens.o(.text+0x258): undefined reference tooperator new

(many more follow)

Cheers,
Steve

operator new[] is a C++ thing; it should be using “g++”, not “gcc”.On Mon, Jan 13, 2003 at 08:00:06AM -0000, Sweeney, Steven (FNB) wrote:

I’ve just had a user write to me saying that they cannot compile my app with
SDL 1.2.4-5 (which they installed via an RPM) for Redhat 8.0

Just trying to eliminate possibilities here… could it be they should
install an earlier version of SDL?

Has anyone else had this problem?

gcc /usr/bin/sdl-config --cflags --libs -lSDL_mixer -lSDL_image ai.o
aliens.o audio.o bullets.o cargo.o collectable.o comms.o events.o
explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o
messages.o misc.o missions.o player.o resources.o script.o shop.o
Starfighter.o title.o unpack.o weapons.o -o starfighter
aliens.o: In function addAlien()': aliens.o(.text+0x258): undefined reference tooperator new


Glenn Maynard

Hello Steven,

Monday, January 13, 2003, 10:00:06 AM, you wrote:

SSF> Has anyone else had this problem?

SSF> aliens.o(.text+0x258): undefined reference to `operator new

“new” is C++ specific and you trying g++ instead of gcc might solve
the problem.–
Lynx,
http://dotNet.lv mailto:@Anatoly_R

Okay then :)> -----Original Message-----

From: Glenn Maynard [SMTP:g_sdl at zewt.org]
Sent: Monday, January 13, 2003 8:23 AM
To: sdl at libsdl.org
Subject: Re: [SDL] undefined reference to `operator new
???

On Mon, Jan 13, 2003 at 08:00:06AM -0000, Sweeney, Steven (FNB) wrote:

I’ve just had a user write to me saying that they cannot compile my app
with
SDL 1.2.4-5 (which they installed via an RPM) for Redhat 8.0

Just trying to eliminate possibilities here… could it be they should
install an earlier version of SDL?

Has anyone else had this problem?

gcc /usr/bin/sdl-config --cflags --libs -lSDL_mixer -lSDL_image ai.o
aliens.o audio.o bullets.o cargo.o collectable.o comms.o events.o
explosions.o game.o globals.o graphics.o init.o intermission.o
loadSave.o
messages.o misc.o missions.o player.o resources.o script.o shop.o
Starfighter.o title.o unpack.o weapons.o -o starfighter
aliens.o: In function addAlien()': aliens.o(.text+0x258): undefined reference tooperator new

operator new[] is a C++ thing; it should be using “g++”, not “gcc”.


Glenn Maynard


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

.sophos.3.64.01.10.

Hello Everyone,

I was trying to find rules for that mailing list but found none.
I think posting my announcement is fine.

I’ve opened “SDLx” - SDL related news portal.

Since “libsdl.org” is being updated rarely lately and it doesn’t tell
you about new versions of software, rumors and other stuff coming out
I thought it would be nice to open alternative news resource.

http://sdl.lynx.lv

There’s an article on first page about stuff I’m planning to add to
that portal. If anyone is interested in helping me or has some ideas,
please don’t write to mailing list - use comment system on site or
mail directly to me.–
Lynx,
http://dotNet.lv mailto:@Anatoly_R