I have such problems either before. However, I find a good way to solve this problem. I wear the heaphones first on the two ears. After the position is fixed, I will wear the eyeglasses to make it adjustable. Then I will feel comfortable. You could try such wearing order.
I am nearsighted and i often wear my eyeglasses and headphones at the same time when i am work with computer. You can just buy headphones with a thick padded seal around the edge. Just wear eyeglasses and headphone as you do as usual. If you still feel uncomfortable, you can buy contact lenses to replace your eyeglasses when you wear headphone. Good luck.
You can wear contact lenses while wearing headphones. If not, you can wear glasses with extra slim frame, which don't cause much discomfort. In addition, you can wear headphones that hook on the ear rather than the full ear muff style headphones. Or purchase a headphone with a looser headband and more cushy pads.