CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

CCS 5.026 __BUILDCOUNT__ problem [SOLVED]

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

CCS 5.026 __BUILDCOUNT__ problem [SOLVED]
PostPosted: Wed Dec 21, 2022 8:27 am     Reply with quote

Compiler: 5.026

Hi guys,

My PC just crashed unexpectedly while I had CCS opened and after rebooting, I continued where I was in my code then when I hit compile, this time it complains with the following:

*** Error 12 "program_name.c" Line 165(74,88): Undefined identifier __BUILDCOUNT__

The thing is this has been in there for weeks and has always worked for the last 10 years.

So I closed this project and re-opened an existing functional one and hit compile and same thing, it complained with the same error.

Then I hit Compile->Clean and tried again and same problem.

So I when in the project options and it was in fact there like I've always had it so then I just removed it, saved, commented-out the code line, recompiled and it worked. Then I went back into the project options and re-added the buildcount option as it was, applied and closed and it complains again.

What's going-on??!

Thanks,

Ben


Last edited by benoitstjean on Thu Dec 22, 2022 7:43 am; edited 1 time in total
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Dec 21, 2022 8:46 am     Reply with quote

Have no idea, for me , it's the 3rd monday of the week.
I now have complete access to a flashdrive that is NOT connected to this Win10 PC ! Just one of the 'gremlins' this week....

Hate to say but maybe reinstall the compiler ? Force a 'defrag' ? Silly idea is there's a bad bit on the HD, and defrag relocates the program to a new spot ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Wed Dec 21, 2022 8:52 am     Reply with quote

Are you sure that the global defines option has not got disabled in the
project options?. __BUILDCOUNT__ is undefined unless this is enabled.
There was an issue with 5.026 sometimes not generating __BUILDCOUNT__
even if this was enabled. If you are using the command line compiler you
need the +G option to enable this, but it is the IDE that increments it.
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Wed Dec 21, 2022 9:17 am     Reply with quote

Thanks for the answer. Like I indicated, before the PC crash an hour ago, all was fine and I was compiling without problems.

I've been using __BUILDCOUNT__ for years and prior to this morning's crash, all was working fine, in fact, I had just compiled and my device was booting normally and I was viewing its boot state on my serial terminal then the PC crashed for no apparent reason.

After the reboot, I re-opened the compiler, hit the build button and that's when I got the error.

So I closed the project and opened another good known working project that I've had for years. Same problem there as well.

It's almost as if a base compiler file got corrupted somewhere in the heart of the compiler. I have no explanation.

Ben
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Wed Dec 21, 2022 9:44 am     Reply with quote

When I had an SSD that was starting to fail, the CCS compiler was my canary in the coalmine, as it were. Weird compilation errors aplenty. I'd reinstall the compiler and all would be fine for weeks to months, then repeat. Since I replaced that computer, no issues.
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Wed Dec 21, 2022 9:48 am     Reply with quote

Ohhh man don't tell me this!! That's also what I am thinking....

I'll have to run a diagnostics test on this drive :(

Thanks for that input.

Ben
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Dec 21, 2022 10:39 am     Reply with quote

yeesh, just had my super smart friend email me...HIS SSD died 2 dayze ago, he's 'up and running' again as he does have real backups of his C: drive....
Sure hope that 'bug' isn't going around !!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Wed Dec 21, 2022 11:02 am     Reply with quote

My thought was that possibly the crash happened while it was writing to
the ccspjt file. As a result the system _lost it_. When he started again
it rebuilt the file. Problem is the default will not have the global option
enabled. This would give exactly the fault being seen.
Hence definitely worth checking that the option is still enabled.....
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Wed Dec 21, 2022 11:24 am     Reply with quote

Yep, options is still enabled. After the reboot when I compiled and got the error, I went back into the option to ensure it was there... and it was. And was also in the ccspjt file with the actual build number.

Not a big deal but very frustrating.

I also found what the cause of the reboot is.... a friggin' USB device.

Ben
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Dec 22, 2022 5:12 am     Reply with quote

I think the classic answer would be 're install the compiler'.
Or if you have a backup restore from this.
Are you sure you were running 5.026?.

The funny thing is if you look at the compiler changes list, you see:
Quote:

5.027 Added __BUILDCOUNT__ id when global defines are enabled


So it was not supported in 5.026. I just tested, and it merrily works
with 5.028, and doesn't with 5.026.
benoitstjean



Joined: 30 Oct 2007
Posts: 566
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Thu Dec 22, 2022 7:42 am     Reply with quote

Actually, you are correct and I made the mistake... While writing this message, I realized what I did.... All is fine, everything's back to normal.

So back many years ago, I contacted CCS about the BUILDCOUNT thing and they did tell me it was available in later **IDE** versions. So what they did is sent me an IDE executable file for 5.071 and explained how to use the PCD 5.026 with the 5.071 IDE in order to get the BUILDCOUNT option.

What happened here is that I remember now that just before the crash, I accidentally unpinned / deleted the shortcut in my bottom taskbar but had a shortcut on my desktop. The desktop shortcut was for the 5.026 IDE whereas the pinned icon on the taskbar was for the 5.071 IDE w/5.026 PCD.

I went back in Windows Explorer and saw the two folders. So I re-launched the 5.071 IDE and now it shows in the "About" that it's using 5.071 with 5.026 PCD.

I uncommented the __BUILDCOUNT__ line in my code and recompiled and now all is fine.

I guess there were a few things that happened just before the crash and didn't realize until now.

So all is back to normal, all is fine.

Thanks for all you help!

Happy holidays!

Ben
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Dec 22, 2022 7:47 am     Reply with quote

Got filed in the 'history' section... Very Happy

That explains how you had that working. Yes, it is the IDE that does the
work of creating & incrementing this. Makes total sense.

Have a great Christmas.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group