www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - undefined identifier doesn't make sense

reply "Enjoys Math" <enjoysmath gmail.com> writes:
Here's Gui.d:

module Gui;

private import gtk.MainWindow;

private import ProjectFile;

//   TODO: remove
private import gtk.Label;

class Gui : MainWindow
{
private:
	ProjectFile* proj;

public:
	this() {
		super("Our Audio Synth App");
		
		proj = ProjectFile.loadLastProjectOrNew();
		
		setDefaultSize(600, 400);	//   TODO: default size should be 
loaded from last user-defined
		maximize();		// Maximize window if available
		
		add(new Label("epic lulz"));
		showAll();
	}

	~this() {

		//    TODO
		// If AppSettings dir DNE
			// Create AppSettings dir

		// Save AppSettings file

	}
}


Here's ProjectFile.d:

module ProjectFile;

private import std.stdio;

struct ProjectFile
{
private:
	struct GuiSettings
	{
		// Main window settings
		uint winPosX, winPosY;
		uint winWidth, winHeight;
	}

public:
	GuiSettings gui;
	

	static ProjectFile* loadLastProjectOrNew()
	{
		// if LastProject.txt exits
		   // open LastProject.txt and read the first line
		   // try opening the file with that path & name
				// if success convert the data into a Project file object and 
return it
		// create new ProjectFile using default constructor and return
		
		auto lastProjectDotTxt = new File("LastProject.txt");
		
		return new ProjectFile;
	}
}

The error is:

Building Debug\TheApp.exe...
Gui.d(19): Error: undefined identifier 'loadLastProjectOrNew'

Doesn't make any sense.
May 20 2013
parent reply Anthony Goins <neontotem gmail.com> writes:
??
ProjectFile.ProjectFile.loadLastProjectOrNew()
?? 
maybe.
May 20 2013
parent reply "Enjoys Math" <enjoysmath gmail.com> writes:
On Tuesday, 21 May 2013 at 03:15:46 UTC, Anthony Goins wrote:
 ??
 ProjectFile.ProjectFile.loadLastProjectOrNew()
 ??
 maybe.
That did it!!! Lol crazy. :D Thx
May 20 2013
parent reply "Enjoys Math" <enjoysmath gmail.com> writes:
Should I put my static methods at module scope then?
May 20 2013
parent "evilrat" <evilrat666 gmail.com> writes:
On Tuesday, 21 May 2013 at 04:17:26 UTC, Enjoys Math wrote:
 Should I put my static methods at module scope then?
just don't give symbol(struct/class/function/variable) names same as module
May 20 2013