DOlson Posted October 6, 2002 Report Share Posted October 6, 2002 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! Quote Link to comment Share on other sites More sharing options...
MoonChild Posted October 6, 2002 Report Share Posted October 6, 2002 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.. Quote Link to comment Share on other sites More sharing options...
DOlson Posted October 7, 2002 Author Report Share Posted October 7, 2002 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. Quote Link to comment Share on other sites More sharing options...
Guest Maciek Posted October 31, 2002 Report Share Posted October 31, 2002 Try using gcc 2.96, the error looks like it's gcc 3.2 related. btw, Mandrake 9.0 can't compile anything, gcc can :) Quote Link to comment Share on other sites More sharing options...
DOlson Posted November 1, 2002 Author Report Share Posted November 1, 2002 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. Quote Link to comment Share on other sites More sharing options...
Glitz Posted November 1, 2002 Report Share Posted November 1, 2002 How's your game machine coming along? Glitz. Quote Link to comment Share on other sites More sharing options...
Guest Maciek Posted November 2, 2002 Report Share Posted November 2, 2002 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? Quote Link to comment Share on other sites More sharing options...
ranger Posted December 21, 2002 Report Share Posted December 21, 2002 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 ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.