I have followed this example and read nomencl package documentation and I can't find a solution. The problem is, that I want to insert nomenclature after TOC, where page numbers are turned off. That is why I get the following error written in .ilg file after makeindex command:

-- Illegal page number .

All the entries are rejected, because it can't include nomenclature without value in nompageref. If I include it after the page numbering starts, than everything works as expected. Here is how the line in .nlo file looks like:

1 Answer
1

or similar. Then the entries in .nlo are missing the page number and makeindex is not happy with those entries without page number. At least a dummy page number is needed and correct page numbers if option refpage of package nomencl is used. Therefore it is better to turn off the page numbers via the page style instead of turning off redefining \thepage:
\pagestyle{empty}, \thispagestyle{empty}, … For more details a MWE would make sense.