0

Hello im trying to compile my simple code of haxe , and it still an error with Meal.hx:1: characters 0-7 is missing ;

i dont know where the error is, here's the code:

Meal.hx

package MyFridge;
class Meal
{
public var name : String;
public function new(f_name : String)
{
this.name = f_name;
}
}
Koyix
  • 181
  • 1
  • 3
  • 17

3 Answers3

1

The class syntax looks valid.

So, Just some double checks;

  • is this the exact code?
  • is the file named Meal.hx?
  • is it located in a folder (package) called MyFridge? Btw, not sur if this makes a difference, but it is common to use lowercase packages/foldernames.
  • is this the only error?
  • if this is part of a larger project, try create a separated test, to make sure the error is really related to this file.
Mark Knol
  • 9,663
  • 3
  • 29
  • 44
  • 1
    The question was asked on the mailing list, the issue was the "MyFridge" package, packages must be lower case. The error message was a bit cryptic, Simn is looking into fixing it :) – Jason O'Neil Jan 14 '14 at 23:43
1

The package name can only contain lowercase letters.

Like this:

package myfridge;

Give that a try.

Gagege
  • 650
  • 3
  • 8
  • 20
0

Look after the package myFridge and uppercase from the code it will take effect for the compiler. good luck :)

Koyix
  • 181
  • 1
  • 3
  • 17