# Error in fontspec.sty

I downloaded a template for CV and one of the requirements was installation of fontspec.sty. Now when I compile the file the code file of fontspec.sty pops up in a new tab in TeXnicCenter and it points to errors in the file. Among which are

fatal fontspec error: "cannot use pdflatex"


It also shows that the .sty requires xetex or luatex to function which I have both installed. Please help.

-

fontspec doesn't work with PDFTeX (and thus pdflatex) indeed. It requires XeTeX or LuaTeX (in recent versions). If the template you are using makes use of fontspec, it means it wants to use system fonts (TTF/OTF/AAT). You will need to compile this document using XeTeX (xelatex) or LuaTeX (lualatex).
You are compiling your template using pdflatex, as is suggested by the error message. Instead, you need to compile it using either xetex (or xelatex) or luatex (or lualatex). You can do this from the command line by typing xetex file.tex (since you mention that xetex is installed), or by defining a new output profile under the Built menu Alt+7 and compiling file.tex using this newly-created profile from within TeXnicCenter.