john27 0 Posted April 29, 2009 Report Share Posted April 29, 2009 This simple code generates the error below. This happens in ver 6.95 and 6.81. What am I missing? //Autocorr5.c // PIC18F2321 #include <system.h> unsigned long sum(void); unsigned long period; void main() { period = sum(); } unsigned long sum(void) //this is line 13 with the "error" { char jj; unsigned long P; P=1; jj=2; P=P+jj; return (P); } Building... BoostC Optimizing C Compiler Version 6.95 (for PIC18 architecture) http://www.sourceboost.com Copyright© 2004-2009 Pavel Baranov Copyright© 2004-2009 David Hobday Single user Lite License (Unregistered) for 0 node(s) Limitations: PIC18 max code size:8192 bytes, max RAM banks:2, Non commercial use only autocorr5.c failure C:\_HHmetronome\HH_PIC18\bug_test\autocorr5.c(13): error: missing right paren C:\_HHmetronome\HH_PIC18\bug_test\autocorr5.c(13): error: general error C:\_HHmetronome\HH_PIC18\bug_test\autocorr5.c(13): error: failure "C:\Program Files\SourceBoost6_95\boostc.pic18.exe" autocorr5.c -t PIC18F2321 Exit code was 1. Removing target: autocorr5.obj Done Quote Link to post Share on other sites
Reynard 0 Posted April 29, 2009 Report Share Posted April 29, 2009 'P' is already defined in the PIC18F2321.h file and therefore your 'P' is being substituted by a hex value. Rename your variable and try again. BoostC errors can be confusing at times. Cheers Reynard Quote Link to post Share on other sites
john27 0 Posted April 29, 2009 Author Report Share Posted April 29, 2009 'P' is already defined in the PIC18F2321.h file and therefore your 'P' is being substituted by a hex value. Rename your variable and try again. BoostC errors can be confusing at times. Cheers Reynard Wow -I didn't think to look there! I'm glad I gave up and posted after only wasting 3 hours on the problem. Thanks, Reynard! Quote Link to post Share on other sites
Pavel 0 Posted May 2, 2009 Report Share Posted May 2, 2009 ...BoostC errors can be confusing at times.... We have modified compiler to provide better error reporting for cases like this. This update will be available in the next release. Regards, Pavel Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.