# lstlistings does not work in a slide

I am writing a slide. I want to use lstlisting

    \documentclass[10pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{listings}
\begin{document}
\begin{frame}{HeartBleed}
\begin{lstlisting}
Hellow world
\end{lstlisting}
\end{frame}
\end{document}


I get an error around around \begin{lstlisting} and it says: job aborted, no legal \end found. How can I resolve this problem ?

-

For the usage of listings you have to use the fragile option for the frame:

\documentclass{beamer}
\usepackage{listings}

\begin{document}
\begin{frame}[fragile]
\begin{lstlisting}
Hello world
\end{lstlisting}
\end{frame}
\end{document}


Further information can be at found http://pbelmans.wordpress.com/2011/02/20/why-latex-beamer-needs-fragile-when-using-verbatim/

-
Thank you very much, it works, and this is very useful for my presentation as I have to do that on several slides. –  user61279 Aug 26 at 12:09