Pages: [1]   Go Down
Author Topic: Compiler problem with main.cpp  (Read 1267 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 614
Posts: 49386
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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"?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26332
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have any code for us?
Logged

"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.

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 614
Posts: 49386
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 304
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: August 18, 2010, 01:16:38 pm by Eight » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

problem solved. There was a typo error made by copy paste  >smiley-sad
Thanks so far
Logged

Pages: [1]   Go Up
Jump to: