undefined identifier doesn't make sense

Enjoys Math enjoysmath at gmail.com
Mon May 20 19:30:51 PDT 2013


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.


More information about the Digitalmars-d-learn mailing list