[Tex/LaTex] fontspec LuaTeX error

fontspecluatexmiktextexstudioxetex

I have installed "ProTeX" with "TeXstudio 2.3" & "Miktex 2.9".
I get an error

! The fontspec package requires either XeTeX or LuaTeX to function

when I attempt to run

\documentclass{article}
\usepackage{fontspec}

\begin{document}
Hello world! 
\end{document}

MikTeX is said to come with some of this installed.

Best Answer

You have to reconfig TeXstudio to use lualatex or xelatex instead of pdflatex which is preconfigured in TeXstudio. You can change it under options, then commands.

You can also use the command line to test whether for example lualatex is running. lualatex test will compile test.tex with lualatex.

Related Question