# Some problem of using SDL under VC++

**URL:** <https://discourse.libsdl.org/t/some-problem-of-using-sdl-under-vc/10939>\
**Category:** SDL Development\
**Created:** [June 14, 2004, 1:05pm UTC](https://discourse.libsdl.org/t/some-problem-of-using-sdl-under-vc/10939 "2004-06-14T13:05:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ww1](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/w/8edcca/32.png) [@ww1](https://discourse.libsdl.org/u/ww1)\
**Post date:** [June 14, 2004, 1:05pm UTC](https://discourse.libsdl.org/t/some-problem-of-using-sdl-under-vc/10939/1 "2004-06-14T13:05:30Z")

</div>

hello, it’s my first time to use SDL to display YUV file.  
I follow the description in “VisualC”, adding two lib(“SDL.lib” and “SDLmain.lib” ) into the project, and setting the project “Multi-threaded DLL” and so on, but when I build the project, the Linker cannot open the lib “SDLmain.lib”:------------------------------------------------------------------------  
--------------------Configuration: ldecod - Win32 Debug--------------------  
Compiling…  
output.c  
F:\gao\H.264\jm76\JM\ldecod\src\output.c(326) : warning C4013: ‘SDL\_LockOverlay’ undefined; assuming extern returning int  
F:\gao\H.264\jm76\JM\ldecod\src\output.c(335) : warning C4013: ‘SDL\_UnlockOverlay’ undefined; assuming extern returning int  
F:\gao\H.264\jm76\JM\ldecod\src\output.c(336) : warning C4098: ‘sdl\_display\_yuv’ : ‘void’ function returning a value  
Linking…  
LINK : fatal error LNK1181: cannot open input file "SDLmain.lib"  
Error executing link.exe.

## ldecod.exe - 1 error(s), 3 warning(s)

# May someone tell me what’s the matter? and how can I fix it? I’ll appreciate your help

??? [http://sms.tom.com/index2.php?inc=3&type=24](http://sms.tom.com/index2.php?inc=3&type=24)  
??? [http://sms.tom.com/index2.php?inc=3&type=26](http://sms.tom.com/index2.php?inc=3&type=26)  
??? [http://sms.tom.com/index2.php?inc=3&type=25](http://sms.tom.com/index2.php?inc=3&type=25)

??? [http://sms.tom.com/index2.php?inc=2](http://sms.tom.com/index2.php?inc=2)  
??? [http://sms.tom.com/index2.php?inc=2&type=3740](http://sms.tom.com/index2.php?inc=2&type=3740)  
??? [http://sms.tom.com/index2.php?inc=2&type=30](http://sms.tom.com/index2.php?inc=2&type=30)

# ??? [http://sms.tom.com/index2.php?inc=song](http://sms.tom.com/index2.php?inc=song)

---

<div class="post-metadata">

**Author:** ![Till\_G\_Bay](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/53a042/32.png) [@Till\_G\_Bay](https://discourse.libsdl.org/u/Till_G_Bay)\
**Post date:** [June 14, 2004, 1:32pm UTC](https://discourse.libsdl.org/t/some-problem-of-using-sdl-under-vc/10939/2 "2004-06-14T13:32:07Z")

</div>

Hey all -

I’m new to sdl and would like to know how I can handle key events when in  
waiting mode instead of polling mode. Right now I only get it to work with  
polling mode…

thanks till\> -----Urspr?ngliche Nachricht-----

> Von: sdl-bounces+till.bay=inf.ethz.ch at [libsdl.org](http://libsdl.org)  
> [mailto:sdl-bounces+till.bay=inf.ethz.ch at [libsdl.org](http://libsdl.org)] Im Auftrag von ww  
> Gesendet: Montag, 14. Juni 2004 15:06  
> An: sdl at [libsdl.org](http://libsdl.org)  
> Betreff: [SDL] Some problem of using SDL under VC++
> 
> ## hello, it’s my first time to use SDL to display YUV file. I follow the description in “VisualC”, adding two lib(“SDL.lib” and “SDLmain.lib” ) into the project, and setting the project “Multi-threaded DLL” and so on, but when I build the project, the Linker cannot open the lib “SDLmain.lib”:
> 
> * * *
> 
> --------------------Configuration: ldecod - Win32  
> Debug--------------------  
> Compiling…  
> output.c  
> F:\gao\H.264\jm76\JM\ldecod\src\output.c(326) : warning  
> C4013: ‘SDL\_LockOverlay’ undefined; assuming extern returning int  
> F:\gao\H.264\jm76\JM\ldecod\src\output.c(335) : warning  
> C4013: ‘SDL\_UnlockOverlay’ undefined; assuming extern returning int  
> F:\gao\H.264\jm76\JM\ldecod\src\output.c(336) : warning  
> C4098: ‘sdl\_display\_yuv’ : ‘void’ function returning a value  
> Linking…  
> LINK : fatal error LNK1181: cannot open input file “SDLmain.lib”  
> Error executing link.exe.
> 
> ## ldecod.exe - 1 error(s), 3 warning(s)
> 
> * * *
> 
> # May someone tell me what’s the matter? and how can I fix it? I’ll appreciate your help
> 
> ??? [http://sms.tom.com/index2.php?inc=3&type=24](http://sms.tom.com/index2.php?inc=3&type=24)  
> ??? [http://sms.tom.com/index2.php?inc=3&type=26](http://sms.tom.com/index2.php?inc=3&type=26)  
> ??? [http://sms.tom.com/index2.php?inc=3&type=25](http://sms.tom.com/index2.php?inc=3&type=25)
> 
> ??? [http://sms.tom.com/index2.php?inc=2](http://sms.tom.com/index2.php?inc=2)  
> ??? [http://sms.tom.com/index2.php?inc=2&type=3740](http://sms.tom.com/index2.php?inc=2&type=3740)  
> ??? [http://sms.tom.com/index2.php?inc=2&type=30](http://sms.tom.com/index2.php?inc=2&type=30)
> 
> # ??? [http://sms.tom.com/index2.php?inc=song](http://sms.tom.com/index2.php?inc=song)

---

<div class="post-metadata">

**Author:** ![jake\_b](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/8edcca/32.png) [@jake\_b](https://discourse.libsdl.org/u/jake_b)\
**Post date:** [June 14, 2004, 3:36pm UTC](https://discourse.libsdl.org/t/some-problem-of-using-sdl-under-vc/10939/3 "2004-06-14T15:36:02Z")

</div>

Is this what you want?

//your input loop  
Uint8 \*keys;

//input  
keys = SDL\_GetKeyState(0);  
if(keys[SDLK\_ESCAPE] == SDL\_PRESSED)  
{  
bDone = true;  
}

— “Till G. Bay” \<till.bay at inf.ethz.ch\> wrote:\> Hey all -

> I’m new to sdl and would like to know how I can handle key  
> events when in  
> waiting mode instead of polling mode. Right now I only get it  
> to work with  
> polling mode…
> 
> thanks till
> 
> > -----Urspr??ngliche Nachricht-----  
> > Von: sdl-bounces+till.bay=inf.ethz.ch at [libsdl.org](http://libsdl.org)  
> > [mailto:sdl-bounces+till.bay=inf.ethz.ch at [libsdl.org](http://libsdl.org)] Im  
> > Auftrag von ww  
> > Gesendet: Montag, 14. Juni 2004 15:06  
> > An: sdl at [libsdl.org](http://libsdl.org)  
> > Betreff: [SDL] Some problem of using SDL under VC++
> > 
> > hello, it’s my first time to use SDL to display YUV file.  
> > I follow the description in “VisualC”, adding two  
> > lib(“SDL.lib” and “SDLmain.lib” ) into the project, and  
> > setting the project “Multi-threaded DLL” and so on, but when
> 
> > I build the project, the Linker cannot open the lib  
> > “SDLmain.lib”:
> 
> * * *
> 
> > * * *
> > 
> > --------------------Configuration: ldecod - Win32  
> > Debug--------------------  
> > Compiling…  
> > output.c  
> > F:\gao\H.264\jm76\JM\ldecod\src\output.c(326) : warning  
> > C4013: ‘SDL\_LockOverlay’ undefined; assuming extern  
> > returning int  
> > F:\gao\H.264\jm76\JM\ldecod\src\output.c(335) : warning  
> > C4013: ‘SDL\_UnlockOverlay’ undefined; assuming extern  
> > returning int  
> > F:\gao\H.264\jm76\JM\ldecod\src\output.c(336) : warning  
> > C4098: ‘sdl\_display\_yuv’ : ‘void’ function returning a value  
> > Linking…  
> > LINK : fatal error LNK1181: cannot open input file  
> > “SDLmain.lib”  
> > Error executing link.exe.
> > 
> > ldecod.exe - 1 error(s), 3 warning(s)
> 
> * * *
> 
> > * * *
> > 
> > # May someone tell me what’s the matter? and how can I fix it? I’ll appreciate your help
> > 
> > ??? [http://sms.tom.com/index2.php?inc=3&type=24](http://sms.tom.com/index2.php?inc=3&type=24)  
> > ??? [http://sms.tom.com/index2.php?inc=3&type=26](http://sms.tom.com/index2.php?inc=3&type=26)  
> > ??? [http://sms.tom.com/index2.php?inc=3&type=25](http://sms.tom.com/index2.php?inc=3&type=25)
> > 
> > ??? [http://sms.tom.com/index2.php?inc=2](http://sms.tom.com/index2.php?inc=2)  
> > ??? [http://sms.tom.com/index2.php?inc=2&type=3740](http://sms.tom.com/index2.php?inc=2&type=3740)  
> > ??? [http://sms.tom.com/index2.php?inc=2&type=30](http://sms.tom.com/index2.php?inc=2&type=30)
> > 
> > # ??? [http://sms.tom.com/index2.php?inc=song](http://sms.tom.com/index2.php?inc=song)
> 
> * * *
> 
> SDL mailing list  
> SDL at [libsdl.org](http://libsdl.org)  
> [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

* * *

Do you Yahoo!?  
Friends. Fun. Try the all-new Yahoo! Messenger.  
[http://messenger.yahoo.com/](http://messenger.yahoo.com/)
