- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there !
Does anyone know about an error that apear just when I am editing a souce file and afterward when you try to build it send you the following message :
prj.M0120:Buld error: syntax error near'{'
prj.M0120:Buld error: syntax error near '}'
The error is about the following 6 element array : txbuf[6]= {0xDC,0x00,0x00,0x00,0x00,0x00};
This array is defined as extern uint8 txbuf in other file.
I would appreciate any help
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Even though, define in external module.
(Creator3.0, PSoC3)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Post the project archieve, not uncommon for a compiler to
report an error on line xx and the error is actually somewhere
before.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank very much all of you !!!
I have bundle the project wich is done in Psoc Creator 3.0, but I could not upload the zip file for bad internet connection.
I will try again later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What about
char txbuf[6]= {0xDC,0x00,0x00,0x00,0x00,0x00};
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, (not yet enough coffee ERROR)
The syntax is correct for a variable's definition but not for a C-statement as far as I know.
Three choices: Initialize the variable where it is defined externally or assign a valyue to the var using any of the copy-commands since the target is an array. Lastly assign separately to var[0]=0xC0, var[1]=0xff, var[2]=0xee ... etc
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a typical syntax error pattern
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Alex101, Chrome has a problem posting files, try IE or Firefox.
Bob is right, you can do this
uint8 txbuf = {0xDC,0x00,0x00,0x00,0x00,0x00};
but not this
extern uint8 txbuf;
..
..
..
txbuf = {0xDC,0x00,0x00,0x00,0x00,0x00};
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Small correction
youc an do this
uint8 txbuf = {0xDC,0x00,0x00,0x00,0x00,0x00};
but not this
uint8 txbuf;
..
..
..
txbuf = {0xDC,0x00,0x00,0x00,0x00,0x00};
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry I'm a little sleep. I rectified some statement.
The conflicting file es " Config_nRF24LF01+, the other one, Read_Write_Reg.c does work ok in other debug project.
Thank you all of you