[Tex/LaTex] How to fix the error “GUI framework cannot be initialized” with TeXnicCenter and MiKTeX

compilingerrorsgeometrymiktextexniccenter

I don't know what I've done, but all of a sudden I am unable to compile any document which uses the geometry package. Minimal (non)-working example:

\documentclass[11pt]{article}     
\usepackage{geometry} 
\begin{document}
test
\end{document}

doesn't produce any output, and this is what I see in my error summary screen in TeXnicCenter:

enter image description here

The red arrow points to what seems to be the problem: something about the bundle "oberdiek" and its package "ifvtex" is causing pdflatex.exe (which, while I don't really know what it does, sounds pretty important) to "not be initialized". I looked up this package, and it's relevance here is a mystery to me.

I've confirmed that all of my files without the geometry package compile just fine; however, that doesn't mean that the problem is with the geometry package – what seems more likely is that there is some hidden cause of the error, and geometry happens to be one way to induce that. By the way, I've tried compiling a document which includes the ifpdf and ifvtex packages separately, and they do just fine; it's only when I include the geometry package (which for some reason requires these ifpdf and ifvtex packages) that the error occurs.

I've tried the only things I can think of:

  • going into MiKTeX Package Manager (by the way I am using 2.8), and removing + reinstalling both geometry and oberdiek
  • refreshing the file name database ("FNDB")
  • deleting all automatically generated files, as well as simply starting over in a new document

So I'm stuck now. I've considered attempting to just get rid of all traces of MiKTeX and TeXnicCenter from my computer and starting over, but that seems a bit excessive – after all, the geometry package was working for me just earlier today. I honestly am not sure what I did to cause this; I've spent today trying to make a better template file for myself, and so I've been trying out new packages, but if I'm not loading these new packages there shouldn't be any conflicts, right?

Actually, I've just now thought of something that I think I did between the last time it worked and now, so is a possible candidate for the cause: I had to install some package manually, as it wasn't available on MiKTeX, and so I created a folder and pointed MiKTeX to it (i.e. the second option described here). The package didn't do what I wanted, so I deleted the folder and removed it from the list of folders I told MiKTeX to check. Perhaps it's still trying to reach it for some reason?

Best Answer

This is a known issue with MiKTeX 2.8. From the MiKTeX 2.8 issues website:

TeXnicCenter compatibility

LaTeX terminates with "GUI framework cannot be initialized" if invoked from TeXnicCenter (1.0 Stable Release Candidate 1). This happens when a missing package needs to be installed and the pop-up window cannot be displayed.

Remedy: start MiKTeX Options and choose either Yes or No (but not "Ask me first") for the option "Install missing packages on-the-fly".

If No is the only option that works, I would suggest updating to MiKTeX 2.9. This is something that you would probably do in the future anyway.