[Tex/LaTex] LaTeX getting “Missing } inserted” error

beamererrorsverbatim

I'm getting "Missing } inserted" error, when compiling with pdflatex and I really don't understand why. This is occurring in a beamer frame. Maybe someone comes up with something useful.

\documentclass{beamer}
...
\usepackage[utf8x]{inputenc}
\usepackage{default}
\usepackage{times}
\usepackage{graphics}
...
\begin{frame}\frametitle{3\textonehalf. Generace}

    \begin{block}{3\textonehalf. Generace}
        \begin{itemize}
            \item OOP
        \end{itemize}
    \end{block}

    \begin{exampleblock}{Jazyky 3\textonehalf. generace}
        \begin{itemize}
            \item první Smalltalk
            \item C{}\verb!++!, Objective-C, Object Pascal, Java
            \item statické / dynamické
        \end{itemize}
    \end{exampleblock}

\end{frame}
...

I get the error on the last line.

Best Answer

the problem, as pointed out by egreg, is that you need to specify

\begin{frame}[fragile]

when including verbatim material in the frame.

this is documented in the beamer manual (texdoc beamer) in section 3.1.3, "verbatim text". (it almost never hurts to check the manual, and the beamer manual is a good one.)