Pages: [1]   Go Down
Author Topic: expected initializer before void  (Read 3120 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to compile my Arduino sketch (https://github.com/mchr3k/arduino/blob/master/wsn_arduino/wsn_arduino.ino) and I am getting a very strange error.

wsn_arduino:-1: error: expected initializer before 'void'
wsn_arduino:-1: error: expected initializer before 'void'
wsn_arduino:13: error: expected initializer before 'void'

I know that this error usually indicates a missing semi colon. However, I'm not sure how I can have missed a semicolon on line -1 and I can't actually spot any missing semi colons.

Can anyone else spot my mistake or suggest what this error means in my case?
Logged

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

I don't know what you expect us to do with that link. All I see are a bunch of confusing links to other place. I have no idea where to go to find your code, nor much interest in trying. Post your code in a code window or as an attachment to the post, if the code is too large.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 208
Posts: 12932
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Make the message window larger and you will see the light...

Code:
sketch_mar14a.cpp:3:24: error: MANCHESTER.h: No such file or directory
sketch_mar14a.cpp:4:26: error: SerialReader.h: No such file or directory
In file included from C:\Projects\Arduino\Sketch\libraries\SdFat/SdFat.h:26,
                 from sketch_mar14a.cpp:5:
C:\Projects\Arduino\Sketch\libraries\SdFat/SdFile.h:36: error: conflicting return type specified for 'virtual void SdFile::write(uint8_t)'
C:\Arduino\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
sketch_mar14a:-1: error: expected initializer before 'void'
sketch_mar14a:-1: error: expected initializer before 'void'
sketch_mar14a:13: error: expected initializer before 'void'
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know what you expect us to do with that link. All I see are a bunch of confusing links to other place. I have no idea where to go to find your code, nor much interest in trying. Post your code in a code window or as an attachment to the post, if the code is too large.

I'm not sure why the link isnt working for you. It is a direct link to my .ino file hosted on GitHub. Clicking the link works fine for me. I will attach the source file directly later today when I am back at a PC.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Make the message window larger and you will see the light...

Code:
sketch_mar14a.cpp:3:24: error: MANCHESTER.h: No such file or directory
sketch_mar14a.cpp:4:26: error: SerialReader.h: No such file or directory
In file included from C:\Projects\Arduino\Sketch\libraries\SdFat/SdFat.h:26,
                 from sketch_mar14a.cpp:5:
C:\Projects\Arduino\Sketch\libraries\SdFat/SdFile.h:36: error: conflicting return type specified for 'virtual void SdFile::write(uint8_t)'
C:\Arduino\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
sketch_mar14a:-1: error: expected initializer before 'void'
sketch_mar14a:-1: error: expected initializer before 'void'
sketch_mar14a:13: error: expected initializer before 'void'

Unfortunately I have already tried expanding the message window. The errors which I posted are the only error output which I get even when I turn on verbose compilation.

If you are trying to reproduce my issue you will need to add all of the same libraries to your arduino workspace libraries folder: https://github.com/mchr3k/arduino/tree/master/libraries. This includes the latest SdFat library which I think fixes the error you are getting.

Unfortunately I can't do better than linking to GitHub as I am posting from my phone. I will try to put together a more helpful zip of the required files later today.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 208
Posts: 12932
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


NOINLINE is not defined.  Remove it from your sketch.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


NOINLINE is not defined.  Remove it from your sketch.


Perfect - this has fixed my problem. Thanks!

This was valid when I was using SD.h which wrapped an older version of SdFat that defined this constant. I updated to use a newer version of SdFat directly and this caused my problem.

https://github.com/mchr3k/arduino/commit/16445a302c34d0a65f88d80fe0203f9072bac4b7
Logged

Pages: [1]   Go Up
Jump to: