ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÓйØSDL°²×°¼°ÒÆÖ²ÎÊÌâ

·¢²¼Ê±¼ä:2013-12-17 10:10:45À´Ô´:ºìÁª×÷Õß:hb881029
¿ª·¢»·¾³£ºubuntu12.04
½»²æ±àÒ빤¾ß£º arm-none -linux-guneabi-gcc


ĿǰÓöµ½ÒªÔÚ¿ª·¢°åÉÏʹÓõÄÓ¦ÓóÌÐò£¬ÐèÒªÓõ½SDL¿â¡£µ¥¶À°²×°SDL°ü£¬¼´Ê¹ÓÃsudo apt-get install libsdl1.2-devÄÜÕý³£°²×°£¬²¢ÄÜÔÚubuntuÉÏʹÓÃgccÕý³£±àÒëÓ¦ÓóÌÐò¡£ºóÃæ²Î¿¼ÍøÉϵÄ×ÊÁÏÀ´ÒÆÖ²SDL £¨¼´ÖØÐÂÔÚÍøÉÏÏÂÔØÒ»¸öSDLÔ­Âë°üÀ´°²×°£©
ÏÈÅäÖãº
......$: ./configure --disable-video-qtopia --disable-video-dummy --disable-video-fbcon --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --target=arm-none-linux-gnueabi --host=arm-linux --enable-video-fbcon
ûÓб¨´í

.......$: make
........$: make install
Ö´ÐÐÁËÉÏÃæÁ½²½Ò²Ã»Óб¨´í¡£²¢ÔÚusr/local/include/Ŀ¼ÏÂÄÜÕý³£²úÉúSDLĿ¼£¬ÔÚusr/local/lib/Ŀ¼ÏÂÒ²ÄÜÓÐÏà¹ØµÄSDL¶¯Ì¬Á´½ÓµÈÎļþ¡£ÒÔÉϵÄÈÕÆÚ¶¼ÊÇ¿ÉÒÔ²éѯµÄΪ¸Õ¸Õ²úÉú¡£

ÏÖÔÚÖ´ÐÐSDL½âѹ°üÖеIJο¼²âÊÔÎļþ testalpha.c
SDL-1.2.15/test$ arm-none-linux-gnueabi-gcc -o testalpha testalpha.c -l/usr/local/include/SDL/ -L/usr/local/lib/ -lSDL
Ôò±¨´íÒ»¶Ñ£¬ÌáʾºÃÏñ»¹ÊÇûÓÐÕÒµ½Ïà¹ØµÄSDLµÄÍ·ÎļþµÈ£¨ÈçÏÂËùʾ£©¡£

testalpha.c:11:17: error: SDL.h: No such file or directory
testalpha.c:23: error: expected ')' before '*' token
testalpha.c:63: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
testalpha.c:150: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'flashes'
testalpha.c:151: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'flashtime'
testalpha.c:153: error: expected ')' before '*' token
testalpha.c:175: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
testalpha.c:176: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
testalpha.c:177: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'position'
testalpha.c:181: error: expected ')' before '*' token
testalpha.c:241: error: expected ')' before 'x'
testalpha.c:247: error: expected ')' before '*' token
testalpha.c:306: error: expected ')' before '*' token
testalpha.c: In function 'main':
testalpha.c:324: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
testalpha.c:324: error: 'info' undeclared (first use in this function)
testalpha.c:324: error: (Each undeclared identifier is reported only once
testalpha.c:324: error: for each function it appears in.)
testalpha.c:325: error: 'SDL_Surface' undeclared (first use in this function)
testalpha.c:325: error: 'screen' undeclared (first use in this function)
testalpha.c:327: error: 'Uint8' undeclared (first use in this function)
testalpha.c:327: error: expected ';' before 'video_bpp'
testalpha.c:328: error: 'Uint32' undeclared (first use in this function)
testalpha.c:328: error: expected ';' before 'videoflags'
testalpha.c:330: error: 'SDL_Event' undeclared (first use in this function)
testalpha.c:330: error: expected ';' before 'event'
testalpha.c:331: error: 'light' undeclared (first use in this function)
testalpha.c:333: error: expected ';' before 'ticks'
testalpha.c:337: error: 'SDL_INIT_VIDEO' undeclared (first use in this function)
testalpha.c:353: error: 'video_bpp' undeclared (first use in this function)
testalpha.c:358: error: 'videoflags' undeclared (first use in this function)
testalpha.c:358: error: 'SDL_SWSURFACE' undeclared (first use in this function)
testalpha.c:368: error: 'SDL_HWSURFACE' undeclared (first use in this function)
testalpha.c:371: error: 'SDL_HWPALETTE' undeclared (first use in this function)
testalpha.c:380: error: 'SDL_RESIZABLE' undeclared (first use in this function)
testalpha.c:383: error: 'SDL_NOFRAME' undeclared (first use in this function)
testalpha.c:386: error: 'SDL_FULLSCREEN' undeclared (first use in this function)
testalpha.c:422: error: 'SDL_DOUBLEBUF' undeclared (first use in this function)
testalpha.c:425: error: 'sprite' undeclared (first use in this function)
testalpha.c:433: error: 'SDL_HWACCEL' undeclared (first use in this function)
testalpha.c:440: error: 'SDL_Rect' undeclared (first use in this function)
testalpha.c:440: error: expected ';' before 'clip'
testalpha.c:441: error: 'clip' undeclared (first use in this function)
testalpha.c:449: error: 'lastticks' undeclared (first use in this function)
testalpha.c:462: error: 'ticks' undeclared (first use in this function)
testalpha.c:475: error: 'event' undeclared (first use in this function)
testalpha.c:477: error: 'SDL_VIDEORESIZE' undeclared (first use in this function)
testalpha.c:484: error: 'SDL_MOUSEMOTION' undeclared (first use in this function)
testalpha.c:491: error: 'SDL_MOUSEBUTTONDOWN' undeclared (first use in this function)
testalpha.c:497: error: expected ';' before 'area'
testalpha.c:499: error: 'area' undeclared (first use in this function)
testalpha.c:507: error: 'SDL_KEYDOWN' undeclared (first use in this function)
testalpha.c:512: error: 'SDLK_ESCAPE' un declared (first use in this function)
testalpha.c:514: error: 'SDLK_t' undeclared (first use in this function)
testalpha.c:527: error: 'SDL_QUIT' undeclared (first use in this function)
testalpha.c:537: error: 'backing' undeclared (first use in this function)
testalpha.c:540: error: 'flashes' undeclared (first use in this function)
testalpha.c:542: error: 'flashtime' undeclared (first use in this function)

ÕâÊÇʲôÎÊÌâÄØ£¿»òÕßÉÏÃæµÄ·½·¨¾ÍÊÇ´íÎóµÄ£¿¿ÉÓÐÆäËûµÄÕýÈ·µÄ°ì·¨£¿ ÍûÖªÕ߸æÖª£¬Íò·Ö¶àл£¡£¡
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. hb881029 ÓÚ 2013-12-17 11:44:24·¢±í:

    ͬʱ£¬È¥µô½»²æ±àÒ룬¸Ä³ÉGcc±àÒ룬»¹ÊÇÓÐÎÊÌâ¡£
    .....$: gcc -o testalpha testalpha.c -l/usr/local/include/SDL/ -L/usr/local/lib/ -lSDL
    ´íÎóÈçÏ£º

    wu@wu-desktop:~/sdl/SDL-1.2.15/test$ wu@wu-desktop:~/sdl/SDL-1.2.15$
    bash: wu@wu-desktop:~/sdl/SDL-1.2.15$: ûÓÐÄǸöÎļþ»òĿ¼

    ÒÀ¾ÉÊÇÕÒ²»µ½SDLµÄÍ·Îļþ£¬ÊDz»ÊÇSDLûÓа²×°³É¹¦°¡£¿£¿