Simply having a student loan will not be a barrier to apply for a mortgage. However, your school loan payments will have an impact and will be considered when applying for a mortgage.
Student Loan Repayment:
Paying your student loan on a timely basis is one of the things that a lender will look at. If you have had any issues in terms of breaking the law with respect to your student loan be sure that this will damage your credit score. If your monthly student loan payments are too high and as a result this is preventing you from getting qualified for a mortgage you may be able to consolidate your student loan or given the option of repayment for a longer term. In this case your monthly payments will be reduced and it may be just enough to get qualified for the mortgage.
Other Impacts of the Student Loan:
Your mortgage approval is also based on your credit history, and your debt to income ratio both of which are impacted by your student loan. In terms of credit history, if you started paying of your student loan right away and make monthly payments on time then this will contribute to your credit history. Also student loans increase the amount of debt that you are carrying. Most lenders will require a maximum of 43% of debt to income ratio. To give you a better perspective of this ratio: Say for example your monthly income is $3000, 43% of $3000 is $1290, and your student loan is $300. This means that all your other debt must be covered by $990 (1290-$300) in order to qualify for a mortgage loan if your monthly income is $3000. If you find that your debt to income ratio is above 43% then you will have to find out a way to either increase your income or reduce your debt, or the best thing would be to accomplish both of these things. On a piece of paper write down your monthly expenses and see what on what aspects of your life style you can save up. For some people in order to accomplish this may be a life changing event but give it time and you will get used to your new life style.