Jump to content

Mandrake 9.0 can't compile SDL apps?


Recommended Posts

Here is the app I'm trying to compile:

 

#include <SDL/SDL.h>

#include <stdio.h>

#include <stdlib.h>



int main()

{

 SDL_Surface *screen;

 SDL_Surface *background;

 SDL_Surface *logo;

 SDL_Rect src, dest;

 Uint32 colorkey;



 if (SDL_Init(SDL_INIT_VIDEO) != 0) {

   printf("Unable to initialize SDL: %sn", SDL_GetError());

   return 1;

 }



 atexit(SDL_Quit);

 

 screen = SDL_SetVideoMode(256,256,32,0);

 if (screen == NULL) {

   printf("Unable to set video mode: %sn",SDL_GetError());

   return 1;

 }

 

 background = SDL_LoadBMP("background.bmp");

 if (background == NULL) {

   printf("Unable to load bitmap.n");

   return 1;

 }



 logo = SDL_LoadBMP("logo.bmp");

 if (background == NULL) {

   printf("Unable to load bitmap.n");

   return 1;

 }



 src.x=0;  src.y=0;

 src.w=logo->w;  src.h=logo->h;

 

 dest.x=100;  dest.y=100;

 dest.w=logo->w;  dest.h=logo->h;



 SDL_BlitSurface(logo, &src, background, &dest);

 SDL_FreeSurface(logo);



 src.x=0;  src.y=0;

 src.w=background->w;  src.h=background->h;

 

 dest.x=0;  dest.y=0;

 dest.w=background->w;  dest.h=background->h;

 

 SDL_BlitSurface(background, &src, screen, &dest);

 SDL_FreeSurface(background);

 

 SDL_UpdateRect(screen, 0, 0, 0, 0);

 

 SDL_Delay(3000);

 

 return 0;

 

}

 

This is the output I get:

 

[dana@digory PLG-4-3]$ make

gcc -o sdl01.exe -lSDL main.cpp

/tmp/cc0VcarP.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'

collect2: ld returned 1 exit status

make: *** [all] Error 1

[dana@digory PLG-4-3]$

 

Is there any fix for this? I kinda NEED to be able to compile SDL stuff... For a school project.

 

Thanks in advance!

Link to comment
Share on other sites

Not that I'm an expert Dolson but...

 

All the SDL libraries are installed by default on my MDK9.

 

Could be a different error... Check versions of SDL, typo errors, uninitialized stuff..

 

Umm... I'm not an expert either, but I know what I'm doing... This program compiled just fine in Mandrake 8.2.

 

My bet is that Mandrake screwed their C++ libraries over, since Blackbox is all screwed on me too.

Link to comment
Share on other sites

  • 4 weeks later...

I'm not moving backwards. Forget it.

 

I just won't use any C++ code at all. That's what I'm doing now, and it is working fine.

 

Mandrake did do something wrong, accoring to the guy who ported Unreal Tournament 2003 and the maintainer of Blackbox, and that has to do with their C++ libraries. That's not gcc's fault.

Link to comment
Share on other sites

I'm not moving backwards. Forget it.

 

I just won't use any C++ code at all. That's what I'm doing now, and it is working fine.

 

Mandrake did do something wrong, accoring to the guy who ported Unreal Tournament 2003 and the maintainer of Blackbox, and that has to do with their C++ libraries. That's not gcc's fault.

 

Why not? Just compile with 2.96. Considering GCC 3.x is quite new, even the stable releases shouldn't be regarded as 100% stable (although this is not the reason why you're getting the mentioned error).

 

By the way, what did Mandrake do wrong?

Link to comment
Share on other sites

  • 1 month later...
Here is the app I'm trying to compile:

 

[dana@digory PLG-4-3]$ make<!--QuoteEBegin--><!--QuoteEBegin-->gcc -o sdl01.exe -lSDL main.cpp<!--QuoteEBegin--><!--QuoteEBegin-->/tmp/cc0VcarP.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'<!--QuoteEBegin--><!--QuoteEBegin-->collect2: ld returned 1 exit status<!--QuoteEBegin--><!--QuoteEBegin-->make: *** [all] Error 1<!--QuoteEBegin--><!--QuoteEBegin-->[dana@digory PLG-4-3]$

 

Is there any fix for this? I kinda NEED to be able to compile SDL stuff... For a school project.

 

Thanks in advance!

 

This looks like you are trying to link objects compiled with one version of gcc (ie 2.96) with libraries compiled with another version (ie gcc-3.2).

 

Which version of gcc are you compiling with? 'gcc -v' would help ...

 

And I don't think that it's Mandrake that has done anything wrong, everything works fine if you don't mix compilers when doing c++ ... and hopefully gcc-3.2 will be forwards-compatible ...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...