error An object reference is required to access non-static member

Hello. I am creating a tower defence game for testing. And i run into this error: Assets/Scripts/Game Scripts/UI/Money.cs(16,25): error CS0120: An object reference is required to access non-static member `UnityEngine.Component.GetComponent(System.Type)’ what is the problem i have no idea. Here is my codes:

Money.cs

using UnityEngine;
using System.Collections;

public class Money : MonoBehaviour {

	private Databasestorage database;
	// Use this for initialization
	void Start () {
	
		database = transform.Find ("Main Camera").GetComponent<Databasestorage> ();
	}
	
	// Update is called once per frame
	void Update () {
	
		GUIText.GetComponent<GUIText> ().text = "Money:" + database.money;
	}
}

Database storage.cs

using UnityEngine;
using System.Collections;

public class Databasestorage : MonoBehaviour {

	public int money = 0;
	private EnemyHealth enemyinfo;
	// Use this for initialization
	void Start () {
	
		enemyinfo = transform.Find ("Enemy").GetComponent<EnemyHealth> ();
	}
	
	// Update is called once per frame
	void Update () {
	

	}
}

I think thats all you need. I hope we can fix this.

The error string gives you a hint : “An object reference is required to access non-static member”
You are trying to call GetComponent from a class, not from an instance. Replace

GUIText.GetComponent ().text = "Money:" + database.money;

by

GetComponent<GUIText> ().text = "Money:" + database.money;

this way, you are calling your Money-instance’s GetComponent method.