SDL2 and SDL2_gfx both define some functions

I’m using SDL2 and I’ve just been adding some SDL2_gfx functionality to my program. In Windows, I’m using the pre-built 2.0.0 SDL2, and I’ve compiled R5 of SDL2_gfx. That works fine.

So I’ve started adding it to Linux. I built SDL2 from source using the 2.0.0 stable source release. I built R5 of SDL2_gfx. However, my program compiles but then fails to link, saying there are multiple definitions of several functions. These are:

_transformSurfaceRGBA
_rotozoomSurfaceSizeTrig
_colorkey
transformSurfaceY

The only use of SDL2_gfx in my program is:

  1. #include <SDL2_gfxPrimitives.h>
  2. filledCircleRGBA
  3. circleRGBA
  4. thickLineRGBA

If I comment out those 3 function calls it links fine, of course.

As far as I can tell, everything is identical between the two setups (same linking order and everything), so what on earth is causing the Linux version to freak out? How can this problem only occur in Linux and not Windows? How can I fix it?

Do the error messages point you to the definitions that are conflicting?
Turn on or install debugging symbols if they don’t.

Is it possible that you’re including the wrong headers? If an older
version of SDL_gfx (say, for SDL 1.2) is installed and your compiler
includes those headers, you may get some interference if the functions are
defined inline, etc.

Jonny DOn Sun, Oct 20, 2013 at 7:09 PM, Dark_Oppressor wrote:

**
I’m using SDL2 and I’ve just been adding some SDL2_gfx functionality to my
program. In Windows, I’m using the pre-built 2.0.0 SDL2, and I’ve compiled
R5 of SDL2_gfx. That works fine.

So I’ve started adding it to Linux. I built SDL2 from source using the
2.0.0 stable source release. I built R5 of SDL2_gfx. However, my program
compiles but then fails to link, saying there are multiple definitions of
several functions. These are:

_transformSurfaceRGBA
_rotozoomSurfaceSizeTrig
_colorkey
transformSurfaceY

The only use of SDL2_gfx in my program is:

  1. #include **
  2. filledCircleRGBA
  3. circleRGBA
  4. thickLineRGBA

If I comment out those 3 function calls it links fine, of course.

As far as I can tell, everything is identical between the two setups (same
linking order and everything), so what on earth is causing the Linux
version to freak out? How can this problem only occur in Linux and not
Windows? How can I fix it?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Fixed, thanks!
http://hg.libsdl.org/SDL/rev/af63b63e7aacOn Sun, Oct 20, 2013 at 4:09 PM, Dark_Oppressor wrote:

**
I’m using SDL2 and I’ve just been adding some SDL2_gfx functionality to my
program. In Windows, I’m using the pre-built 2.0.0 SDL2, and I’ve compiled
R5 of SDL2_gfx. That works fine.

So I’ve started adding it to Linux. I built SDL2 from source using the
2.0.0 stable source release. I built R5 of SDL2_gfx. However, my program
compiles but then fails to link, saying there are multiple definitions of
several functions. These are:

_transformSurfaceRGBA
_rotozoomSurfaceSizeTrig
_colorkey
transformSurfaceY

The only use of SDL2_gfx in my program is:

  1. #include **
  2. filledCircleRGBA
  3. circleRGBA
  4. thickLineRGBA

If I comment out those 3 function calls it links fine, of course.

As far as I can tell, everything is identical between the two setups (same
linking order and everything), so what on earth is causing the Linux
version to freak out? How can this problem only occur in Linux and not
Windows? How can I fix it?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Oh my goodness Sam, you are the man! Thank you! My Linux and OSX builds are both working now.

Sam Lantinga wrote:> Fixed, thanks!http://hg.libsdl.org/SDL/rev/af63b63e7aac (http://hg.libsdl.org/SDL/rev/af63b63e7aac)

On Sun, Oct 20, 2013 at 4:09 PM, Dark_Oppressor <DarkOppressor at gmail.com (DarkOppressor at gmail.com)> wrote:

  I'm using SDL2 and I've just been adding some SDL2_gfx functionality to my program. In Windows, I'm using the pre-built 2.0.0 SDL2, and I've compiled R5 of SDL2_gfx. That works fine.

So I’ve started adding it to Linux. I built SDL2 from source using the 2.0.0 stable source release. I built R5 of SDL2_gfx. However, my program compiles but then fails to link, saying there are multiple definitions of several functions. These are:

_transformSurfaceRGBA
_rotozoomSurfaceSizeTrig
_colorkey
transformSurfaceY

The only use of SDL2_gfx in my program is:

  1. #include
  2. filledCircleRGBA
  3. circleRGBA
  4. thickLineRGBA

If I comment out those 3 function calls it links fine, of course.

As far as I can tell, everything is identical between the two setups (same linking order and everything), so what on earth is causing the Linux version to freak out? How can this problem only occur in Linux and not Windows? How can I fix it?


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Great! You’re welcome! :)On Sun, Oct 20, 2013 at 10:38 PM, Dark_Oppressor wrote:

**
Oh my goodness Sam, you are the man! Thank you! My Linux and OSX builds
are both working now.

Sam Lantinga wrote:

Fixed, thanks!http://hg.libsdl.org/SDL/rev/af63b63e7aac

On Sun, Oct 20, 2013 at 4:09 PM, Dark_Oppressor <> wrote:

Quote:

I’m using SDL2 and I’ve just been adding some SDL2_gfx functionality to
my program. In Windows, I’m using the pre-built 2.0.0 SDL2, and I’ve
compiled R5 of SDL2_gfx. That works fine.

So I’ve started adding it to Linux. I built SDL2 from source using the
2.0.0 stable source release. I built R5 of SDL2_gfx. However, my program
compiles but then fails to link, saying there are multiple definitions of
several functions. These are:

_transformSurfaceRGBA
_rotozoomSurfaceSizeTrig
_colorkey
transformSurfaceY

The only use of SDL2_gfx in my program is:

  1. #include
  2. filledCircleRGBA
  3. circleRGBA
  4. thickLineRGBA

If I comment out those 3 function calls it links fine, of course.

As far as I can tell, everything is identical between the two setups (same
linking order and everything), so what on earth is causing the Linux
version to freak out? How can this problem only occur in Linux and not
Windows? How can I fix it?


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I get it. :smiley:

Jonny DOn Mon, Oct 21, 2013 at 1:42 AM, Sam Lantinga wrote:

Great! You’re welcome! :slight_smile:

On Sun, Oct 20, 2013 at 10:38 PM, Dark_Oppressor wrote:

**
Oh my goodness Sam, you are the man! Thank you! My Linux and OSX builds
are both working now.

Sam Lantinga wrote:

Fixed, thanks!http://hg.libsdl.org/SDL/rev/af63b63e7aac

On Sun, Oct 20, 2013 at 4:09 PM, Dark_Oppressor <> wrote:

Quote:

I’m using SDL2 and I’ve just been adding some SDL2_gfx functionality to
my program. In Windows, I’m using the pre-built 2.0.0 SDL2, and I’ve
compiled R5 of SDL2_gfx. That works fine.

So I’ve started adding it to Linux. I built SDL2 from source using the
2.0.0 stable source release. I built R5 of SDL2_gfx. However, my program
compiles but then fails to link, saying there are multiple definitions of
several functions. These are:

_transformSurfaceRGBA
_rotozoomSurfaceSizeTrig
_colorkey
transformSurfaceY

The only use of SDL2_gfx in my program is:

  1. #include
  2. filledCircleRGBA
  3. circleRGBA
  4. thickLineRGBA

If I comment out those 3 function calls it links fine, of course.

As far as I can tell, everything is identical between the two setups
(same linking order and everything), so what on earth is causing the Linux
version to freak out? How can this problem only occur in Linux and not
Windows? How can I fix it?


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org