21did21 wrote:now this example works, i just have to compil 2 times.
Yes, a newly created (or updated) document may require two times compilations: int he first, the labels are written to the .aux file (yet references are unknown), in the second run LaTeX is able now to see the labels in the .aux file and can print the references.
21did21 wrote:=> but my real .tex doesn't work even if i compil 5 times

You could always make a copy and hack it down step by step, in each step compile 2 times and check. Either
- the error goes away, so you have located the problem to exactly the code piece you removed in the step - fix that piece or show it
- or the error remains, you end with a small example which shows the error and which you can post.
While hacking down always is a good way, building a new "similar" example is no guarantee that the error can be recreated, as you have noticed.
Stefan