[SOLVED]Problem with basic example on wiki

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Z0MBiE
Prole
Posts: 5
Joined: Wed Nov 21, 2012 2:54 am

[SOLVED]Problem with basic example on wiki

Post by Z0MBiE »

I've recently installed Linux and decided to give Love a go on it, thought I'd do a basic message from the wiki:

Code: Select all

function love.draw()
    love.graphics.print("Hello World", 400, 300)
end
but it's giving me the error:

Code: Select all

Error: Syntax error: main.lua:3: '=' expected near ' '

stack traceback:
	[C]: at 0x0047e930
	[C]: in function 'require'
	[string "boot.lua"]:331: in function <[string "boot.lua"]:227>
	[C]: in function 'xpcall'
any ideas? It's probably something really simple I've missed knowing my luck :crazy:
Last edited by Z0MBiE on Fri Feb 22, 2013 1:04 am, edited 1 time in total.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Problem with basic example on wiki

Post by josefnpat »

Can you post your installed love version?

Code: Select all

love --version
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Z0MBiE
Prole
Posts: 5
Joined: Wed Nov 21, 2012 2:54 am

Re: Problem with basic example on wiki

Post by Z0MBiE »

josefnpat wrote:Can you post your installed love version?

Code: Select all

love --version
Sure can:

Code: Select all

$ love --version
LOVE 0.8.0 (Rubber Piggy)
EDIT: You know what, ignore this. I was being lazy and copy/pasting the code to the console. I'm guessing something slipped in there that shouldn't have. Works perfectly fine after typing it in manually.

Lesson learned. Sorry for wasting your time.
Last edited by Z0MBiE on Thu Feb 21, 2013 11:51 pm, edited 1 time in total.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Problem with basic example on wiki

Post by josefnpat »

Can you provide your exact steps to doing this?

I repeated the process just now, and it worked.

Code: Select all

mkdir test
cd test
touch main.lua
nano main.lua
love .
main.lua contains, and only contains;

Code: Select all

function love.draw()
    love.graphics.print("Hello World", 400, 300)
end
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Z0MBiE
Prole
Posts: 5
Joined: Wed Nov 21, 2012 2:54 am

Re: Problem with basic example on wiki

Post by Z0MBiE »

Edited my previous post, sorry about this. :oops:
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: [SOLVED]Problem with basic example on wiki

Post by bartbes »

Looks like you had some invisible unicode character in there or something.
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: [SOLVED]Problem with basic example on wiki

Post by miko »

bartbes wrote:Looks like you had some invisible unicode character in there or something.
Right, most probably "hard space"
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest