Society of Robots - Robot Forum

Software => Software => Topic started by: scottad73 on July 29, 2010, 10:46:43 PM

Title: PWM_Examples.c problems
Post by: scottad73 on July 29, 2010, 10:46:43 PM
I also downloaded and tried to build the PWM_Examples project from the Demo Code for the AxonII.  I got the following errors:

Build started 29.7.2010 at 22:33:48
elds -fpack-struct -fshort-enums -MD -MP -MT PWM_Examples.o -MF dep/PWM_Examples.o.d  -c  ../PWM_Examples.c

../PWM_Examples.c: In function 'pwmInitHertz':
../PWM_Examples.c:47: error: expected declaration specifiers or '...' before '&' token
../PWM_Examples.c:47: error: expected declaration specifiers or '...' before numeric constant
../PWM_Examples.c:47: error: expected declaration specifiers or '...' before numeric constant
../PWM_Examples.c:47: error: expected declaration specifiers or '...' before '(' token
../PWM_Examples.c:48: error: expected declaration specifiers or '...' before '&' token
../PWM_Examples.c:48: error: expected declaration specifiers or '...' before numeric constant
../PWM_Examples.c:48: error: expected declaration specifiers or '...' before numeric constant
../PWM_Examples.c:48: error: expected declaration specifiers or '...' before '(' token
../PWM_Examples.c:48: error: redefinition of parameter 'pwmInitHertz'
../PWM_Examples.c:47: error: previous definition of 'pwmInitHertz' was here
../PWM_Examples.c:52: error: expected declaration specifiers before 'pwmSetDutyCycle'
../PWM_Examples.c:53: error: expected declaration specifiers before 'pwmSetDutyCycle'
../PWM_Examples.c:57: error: expected declaration specifiers before 'pwmInitDeciHertz'
../PWM_Examples.c:58: error: expected declaration specifiers before 'pwmInitDeciHertz'
../PWM_Examples.c:59: error: expected declaration specifiers before '}' token
../PWM_Examples.c:65: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
../PWM_Examples.c:83: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
../PWM_Examples.c:88: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
../PWM_Examples.c:103: error: old-style parameter declarations in prototyped function definition
../PWM_Examples.c:101: error: expected '{' at end of input
../PWM_Examples.c:101: warning: no return statement in function returning non-void
../PWM_Examples.c: In function 'regular_PWM':
../PWM_Examples.c:101: error: expected declaration or statement at end of input
make: *** [PWM_Examples.o] Error 1
Build failed with 21 errors and 1 warnings...

I'm wondering if there is an error on my side some how, I made no modifications to the code or with the code.  I did replace the SoR_Utils.h file with the one you had linked to see if that would fix the problem but it did not.
Thank you for your help.
Title: Re: PWM_Examples.c problems
Post by: scottad73 on July 29, 2010, 11:04:31 PM
I forgot to mention that I am using the Webbotlib version 1.22
Title: Re: PWM_Examples.c problems
Post by: Admin on July 30, 2010, 09:11:05 AM
I just verified it still works fine under WebbotLib v1.22. There's something you aren't doing right . . .

Quote
I did replace the SoR_Utils.h file with the one you had linked to see if that would fix the problem but it did not.
PWM_Examples has no other file, its just a single .c . . . ;D