Go Down

Topic: Compiler problem with main.cpp (Read 1 time) previous topic - next topic

klaus313

Hi all,
I'm new here  and with Arduino :-)
And now my first issue rised up ...
I try to build up my first HW and SW to control a LCD dogm_lcd lib.
The code is just fine but I gett the following compiler error:

C:\arduino\arduino-0018\hardware\arduino\cores\arduino\main.cpp: In function 'int main()':

C:\arduino\arduino-0018\hardware\arduino\cores\arduino\main.cpp:5: error: 'init' was not declared in this scope

C:\arduino\arduino-0018\hardware\arduino\cores\arduino\main.cpp:7: error: 'setup' was not declared in this scope

C:\arduino\arduino-0018\hardware\arduino\cores\arduino\main.cpp:10: error: 'loop' was not declared in this scope

I have absolutely no glue what is wrong here.
could somebody give me some hints

Thanks
Klaus

PaulS

Quote
The code is just fine but I gett the following compiler error:

If the compiler doesn't like the code, then, by what definition is it "just fine"?

klaus313

ok than its may be not fine :-) at least I copied the original library code with the example file, assuming its fine and no error on "my" code appeared.
do you have any help for me ?

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

PaulS

The Arduino "manufactures" the main function. I'm guessing that you are providing one, and that there is no setup() function, no init() function, and no loop() function. These are required for any Arduino application.

klaus313

sorry, he code is 1:1 copied from the following source:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1217184420
extraced to:
dogm_lcd.pde
dogm_lcd.h
dogm_led.cpp

Arduino SW version is 0018



Eight

#6
Aug 18, 2010, 08:14 pm Last Edit: Aug 18, 2010, 08:16 pm by Eight Reason: 1
That's a library, so you need to create a normal sketch with a setup() and loop() then create an instance of dogm_lcd.

I suspect you're trying to run the library instead.

Edit:
The dogm_lcd.h and .cpp files probably want to go into your Libraries folder. I'm guessing the .pde is the basic sketch that instances the library.

klaus313

problem solved. There was a typo error made by copy paste  >:(
Thanks so far

Go Up