dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

SDL "gluks" ar kompilaciju

 
dev.gamez.lv Forum Index -> Grafikas programmēšana un teorija
View previous topic :: View next topic  
Author Message
wechuks



Joined: 16 Dec 2007
Posts: 4

PostPosted: Sat Jan 05, 2008 12:09 pm    Post subject: SDL "gluks" ar kompilaciju

karo4 , saku nemties ar SDL uzraxtiju sitadu kodu pats

Code:

#include <SDL.h>
#include <string>

SDL_Surface *screen=NULL;
SDL_Surface *background=NULL;

int main(){



 if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) == -1){
     printf("kkas nesanaaca:", SDL_GetError());
    exit(1);
  }

  screen=SDL_SetVideoMode(450, 500, 24 , SDL_SWSURFACE);
  SDL_WM_SetCaption( "aaa", NULL );
  background = SDL_LoadBMP("bgr.bmp");
}


tikai kad meginu kompilet ar Code:Blocks izmet sitadu error
Linking executable: kkkas.exe
C:\Documents and Settings\martins\Desktop\SDL\lib/libSDLmain.a(SDL_win32_main.o): In function `console_main':
/Users/hercules/trunk/SDL-1.2/./src/main/win32/SDL_win32_main.c:246: undefined reference to `SDL_main'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 3 seconds)
1 errors, 0 warnings

PS: no kurienes tur herkules nezinu Wink
Back to top
View user's profile
bubu
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 23 Mar 2004
Posts: 3223
Location: Riga

PostPosted: Sat Jan 05, 2008 12:27 pm    Post subject:

SDL FAQ neapskatīji? http://www.libsdl.org/cgi/docwiki.cgi/FAQ_20Frequently_20Asked_20Questions
Tur ir atbilde uz tavu jautājumu: http://www.libsdl.org/cgi/docwiki.cgi/FAQ_20Undefined_20Reference_20to_20SDL_5fmain
Lietojot SDL, main funkcija obligāti jādefinē ar diviem parametriem, pat ja tu tos neizmantosi:
Code:
int main(int, char**)
Back to top
View user's profile Send e-mail
wechuks



Joined: 16 Dec 2007
Posts: 4

PostPosted: Sat Jan 05, 2008 12:38 pm    Post subject:

pat neiedomajos tur meklet Smile
paldies
sa vai taa, kkas tur nav , jo bgr.bmp itka ieladejas , bet tas logs izlec melns Sad
Back to top
View user's profile
coderpp



Joined: 20 Aug 2005
Posts: 167
Location: Rīga, Koknese, Gajiena

PostPosted: Sat Jan 05, 2008 1:32 pm    Post subject:

wechuks wrote:
pat neiedomajos tur meklet Smile
sa vai taa, kkas tur nav , jo bgr.bmp itka ieladejas , bet tas logs izlec melns

Viss tur kārtībā. Tu jau to bildi tikai ielādē, bet ar viņu neko nedari.
Paskaties šeit http://gpwiki.org/index.php/SDL:Tutorials:Displaying_a_Bitmap
Back to top
View user's profile Send e-mail
Display posts from previous:   
dev.gamez.lv Forum Index -> Grafikas programmēšana un teorija All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group