Question

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;
}
}
Was it helpful?

Solution 3

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

OTHER TIPS

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.

The package name can only contain lowercase letters.

Like this:

package myfridge;

Give that a try.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top