Arduino Leonardo collect2.exe error

hello, I have a Arduino Leonardo board, I’m just beggining and I want to make a 3x3x3 Led Cube, but when I try to upload the program, I recieve this error message:

Arduino:1.6.5 (Windows 7), Board:“Arduino Leonardo”

C:\Users\JUANPA~1\AppData\Local\Temp\build7000374757456762027.tmp/core.a(main.cpp.o): In function main': C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:40: undefined reference to setup’
C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `loop’
collect2.exe: error: ld returned 1 exit status

I’m new to electronics or programming and I have absolutely no idea what this means
Anyone knows what I should do?
I have attached the sketch below

Thanks

ledcube.ino (4.36 KB)

  1. Edit your first post to include a more descriptive title. Maybe "Arduino Leonardo collect2.exe error"
  2. Please post your code in your post. (Use the code tags (top left in font gui, right above the smiley face)
  3. What have you tried and how is your arduino hooked up?

Give more info, and you'll probably get more help

Tried to compile. Didn't have the .h file. Attach that file too if you want to get some help.

sorry about that

the code is too long to post here, so I’m gonna attach the .zip library, there are all the files

thanks for replying

LedCube.zip (7.77 KB)

Very nice, but all I found is definitions/declarations for an object. You do know that you need actual code to set up an object and make use of it?

Here is the big clue in your error message:

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:40: undefined reference to setup' C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to loop'

You need a program with a function setup() to do things that are to be done once, like initialization.
You need a program with a function loop() to do things repeatedly. It will be called repeatedly after setup() is called once.

Each of these functions take no arguments and return no values (void).

Good luck!

op's code does have setup and loop. So I wanted to try and compile it. Right, I will need ledcube.cpp too.

liudr:
op’s code does have setup and loop. So I wanted to try and compile it. Right, I will need ledcube.cpp too.

I’m gonna attach it to this message

vaj4088:
Very nice, but all I found is definitions/declarations for an object. You do know that you need actual code to set up an object and make use of it?

Here is the big clue in your error message:

C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:40: undefined reference to setup' C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to loop’

You need a program with a function setup() to do things that are to be done once, like initialization.
You need a program with a function loop() to do things repeatedly. It will be called repeatedly after setup() is called once.

Each of these functions take no arguments and return no values (void).

Good luck!

I’m a noob, seriously, I only download the code from the internet and I’m trying to compile un my arduino, but I don’t know any other thing, for do what you are saying, what I need to do? Can you explain me?

LedCube.cpp (7.03 KB)

Now with the files I get "taking address of temporary array" errors on all of the cube.createFrame() commands. Have you successfully compiled this expression before? It does seem invalid, grabbing (byte) {0, 6, 1, 6, 2, 6} address.

In some point, I get the same error, as I said before, I only download the code and I'm trying to compile it, but I can't, I can't compile it successfully

I try with another code, a code for another 3x3x3 LedCube, it allow me to compile, but the LedCube doesn't work propperly