[Linux-programlama] Re: linux oyun programlama

---------

[Linux-programlama] Re: linux oyun programlama

From: koray mehmet <koraysariteke_at_gmail.com>
Date: Tue, 8 Jan 2008 16:00:47 +0200
Message-ID: <396a0ec70801080600s639fc18gb71f3e9271fa5e37@mail.gmail.com>

#include *<*stdio*.*h*>*
#include *<*stdlib*.*h*>*

#include *<*SDL/SDL*.*h*>*

*// The functions are not shown to save space
**void* DrawPixel*(*SDL_Surface *screen*,* *int* x*,* *int* y*,*
                                    Uint8 R*,* Uint8 G*,* Uint8 B*)**;*
*void* Slock*(*SDL_Surface *screen*)**;*
*void* Sulock*(*SDL_Surface *screen*)**;*

*int* *main**(**int* argc*,* *char* *argv*[**]**)*
*{*

  *if* *(* SDL_Init*(*SDL_INIT_AUDIO|SDL_INIT_VIDEO*)* *<* 0 *)*
  *{*
    printf*(*"Unable to init SDL: %s\n"*,* SDL_GetError*(**)**)**;*
    exit*(*1*)**;*
  *}*
  atexit*(*SDL_Quit*)**;*

  SDL_Surface *screen*;*
  screen=SDL_SetVideoMode*(*640*,*480*,*32*,*SDL_HWSURFACE|SDL_DOUBLEBUF*)**;*
  *if* *(* screen == NULL *)*
  *{*
    printf*(*"Unable to set 640x480 video: %s\n"*,* SDL_GetError*(**)**)**;*
    exit*(*1*)**;*
  *}*

  *// DRAWING GOES HERE
*
  *return* 0*;*
*}*

kod yukardaki gibi. /usr/local/include de SDLdosyasý var. Projeyi eclipsde
new -> c++ porject -> Hello world c++ project olarak oluþturdum. yani
executable proje oluþturdum. make file ben hazýrlamadým.
aldýðým error
Severity and Description Path Resource Location Creation Time
Id
make: *** [sdldeneme] Error 1 sdl deneme line 0
1199800354012 104
undefined reference to `SDL_GetError' sdl deneme/src deneme.cpp
line 18 1199800354010 100
undefined reference to `SDL_GetError' sdl deneme/src deneme.cpp
line 27 1199800354012 103
undefined reference to `SDL_Init' sdl deneme/src deneme.cpp line
16 1199800354010 99
undefined reference to `SDL_Quit' sdl deneme/src deneme.cpp line
21 1199800354011 101
undefined reference to `SDL_SetVideoMode' sdl deneme/src deneme.cpp
line 24 1199800354011 102

baþlýk dosyasýna ulaþýlabiliyor ama sanýrým libraryi bulamýyor
bi sayfada linker bulamýyor diyordu. sanýrým linkerda sorun var ama nasýl
yapýcam bilmiyorum.
ayrýca
/usr/local/lib de libSDL.a, libSDL.la, libSDL.so, libSDL-1.2.so.0,
libSDL-1.2.so.0.11.2, libSDLmain.a dosyalarý var. þaþýrdým kaldým :D

On Jan 8, 2008 1:03 PM, Anýl KARADAÐ <anil.karadag_at_gmail.com> wrote:

> açtýðýnýz projenizin properties kýsmýna gelip baþlýk dosyalarýný
> inceleyiniz. SDL dinizi ekli olmayabilir
>
> Sal, 2008-01-08 tarihinde 12:24 +0200 saatinde, Aykut KOÇAK yazdý:
> > Tam çýktýyý gönderir misiniz?
> >
> > eclipse içerisinde mi derliyorsunuz? kendi make dosyanýzýmý yazdýnýz?
> >
> > Kolay gelsin.
> >
> > koray mehmet yazmýþ:
> > > merhabalar,
> > >
> > > bu ilk mesajým, belirtmek isterim.
> > >
> > > Normalde Windows kullanýcýsýydým. Linuxa geçmek için debeleniyorum.
> > > Biraz C++ bilgim var ve eclipse idesini kullanaraktan oyun yazmak
> > > istiyorum. sonrasýnda online oyunda düþünürüz.
> > > http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/index
> > > sdl kütüphanesinin tutorialýný gördüm. sdl kütüphanesinin source
> > > dosyasnýný indirdim ve ./configure, make, make install dedim ve bir
> > > yerlere biþeyler attý.
> > >
> > > #include *<*stdio*.*h*>*
> > > #include *<*stdlib*.*
> > > h*>*
> > >
> > > #include *<*SDL/SDL*.*h*>*
> > >
> > >
> > > /// The functions are not shown to save space
> > > /*void* DrawPixel*(*SDL_Surface *screen*,*
> > > *int* x*,* *int* y*,*
> > > Uint8 R*,*
> > > Uint8 G*,* Uint8 B*)**;*
> > > *void* Slock*(*SDL_Surface
> > > *screen*)**;*
> > > *void* Sulock*(*SDL_Surface *screen
> > > *)**;*
> > >
> > >
> > > *int* *main**(**int* argc
> > > *,* *char* *argv*[**]**)*
> > > *{*
> > >
> > >
> > > *if* *(* SDL_Init*(*SDL_INIT_AUDIO|SDL_INIT_VIDEO*)*
> > > *<* 0 *)*
> > > *{*
> > > printf*(*"Unable to init SDL: %s\n"
> > > *,* SDL_GetError*(**)**)**;*
> > > exit
> > > *(*1*)**;*
> > > *}*
> > > atexit*(*SDL_Quit
> > > *)**;*
> > >
> > > SDL_Surface *screen*;*
> > > screen=SDL_SetVideoMode*(*
> > > 640*,*480*,*32*,*SDL_HWSURFACE|SDL_DOUBLEBUF
> > > *)**;*
> > > *if* *(* screen == NULL *)*
> > >
> > > *{*
> > > printf*(*"Unable to set 640x480 video: %s\n"*,* SDL_GetError
> > > *(**)**)**;*
> > > exit*(*1*)*
> > > *;*
> > > *}*
> > >
> > > /// DRAWING GOES HERE
> > > /
> > > *return* 0
> > > *;*
> > >
> > >
> > >
> > > kodu derlediðimde undefined referance hatasý veriyor. include ediyorum
> > > ama linkerda biþeyler yapmam lazýmmýþ yalnýz nasýl yapacaðýmý
> bulamadým.
> > >
> > > þimdiden teþekkür ederim
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Linux-programlama mailing list
> > > Linux-programlama_at_liste.linux.org.tr
> > > http://liste.linux.org.tr/mailman/listinfo/linux-programlama
> >
> >
>
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama_at_liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>

_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Tue 08 Jan 2008 - 15:28:53 EET

---------

Bu arsiv hypermail 2.2.0 tarafindan uretilmistir.