Problem with MENU resource in Think C 6

I know CodeWarrior is supposed to be better than Think C - but I have Think C and I have the manuals. But…

…I have an odd problem that I haven’t seen before, and it’s been a while since I last used Think C and I’m clearly forgetting something…

…When I try to build my application, the MENU ids in the rsrc file apparently conflict with… something. Although I’ll be damned if I can work out what, because whatever it is it isn’t in my code. Does anyone have any thoughts?
 
What do you mean conflict with? What message or behaviour are you actually seeing? What do the MENU resources in the built application look like? (Look in ResEdit)
 
Not 100% sure about THINK C, but is the debugger turned on?
If so, I kinda remember something about it having it's own menus that it can insert into the menu bar for that purpose that might use some of IDs you're using? (wild guess). Maybe try moving your IDs to something astronomical, like 300+ to test?
 
@VMSZealot When you compile or build/run, THINK C creates its own resource file with the same name as your project. Usually it'll update it if you make changes to your primary resource file, but I've run into an occasional bug where it doesn't (then it complains there are duplicates.) Try deleting the resource file THINK C created so only your primary resource file is in the project folder, then update and build/run.

Also, if a all else fails, make a new project and re-import all your files. THINK C will occasionally corrupt the project file.
 
Ahh - thanks for this advice. I haven’t seen an rsrc file create by Think C - where would it have put it? I couldn’t see one by Think C in my project folder. Also, if I build without my resource file then the resultant application contains no MENUs - which is surely at odds with Think C creating a resource file?
 
Not 100% sure about THINK C, but is the debugger turned on?
If so, I kinda remember something about it having its own menus that it can insert into the menu bar for that purpose that might use some of IDs you're using? (wild guess). Maybe try moving your IDs to something astronomical, like 300+ to test?
At this stage, the debugger isn’t on - and I tried the astronomical ID trick already. It just resulted in the reported conflict being with the new numbers that I created. A clue perhaps?
 
What do you mean conflict with? What message or behaviour are you actually seeing? What do the MENU resources in the built application look like? (Look in ResEdit)
There is no built application. The build fails. And if I omit my rsrc file then the build succeeds - but with no MENUs resources in the application bundle. I can’t remember the exact error reported either (and it’s too later for me to turn on my old Mac now!) - but I’ll let you know tomorrow.
 
it almost sounds like you've somehow managed to add the resource file to your project twice. Can you check if you have done so? (or stuffit up the project folder and send it over to me)
 
Thanks for the offer. I may take you up on that. I'm going to try to recreate the Project folder first. I've never seen anything quite like it before.
 
Okay. So I recreated the project and the problem moved. Strewth. It's fighting me, this one. The background. I'm updating a game that I sell on the various App Stores - it's called Innecto, and it currently runs on macOS, iOS and iPadOS. The new version is a lot fancier, and adds TV and Watch as well - so I thought I'd call it (at least in my head) Innecto Everywhere. But then I was left too long on my own, and I started having stupid thoughts - thoughts like, how can it be everywhere if it doesn't run on every type of Macintosh? Not Android, DOS or Windows you notice - not an everywhere that might have any lexical meaning - but the sort of everywhere that matters to me.

So I started to port the Watch version to vintage Macs. And that's where the problems started. Also, I've spotted a few (okay, a tonne) of bugs and issues that need to be fixed even after this weird resource issue is solved. But one step at a time. And yes, I know that XML is a stupid format for the levels data on a vintage Mac. I'll fix that. I also know that the TEXT resource can't handle data sizes large enough to be of use - I'll handle that too (probably by splitting over multiple TEXT resources). And… and…

But seriously. Any suggestions will be gratefully received. And yes, I will finish working on ChipWits at some point. But if I can't get this to work, what hope do I have with that?
 

Attachments

Ahh - thanks for this advice. I haven’t seen an rsrc file create by Think C - where would it have put it? I couldn’t see one by Think C in my project folder. Also, if I build without my resource file then the resultant application contains no MENUs - which is surely at odds with Think C creating a resource file?
It's created in the same folder as your project file. It'll have the same name, except with a .rsrc extension (i.e. project-name.π.rsrc)
 
As you can see from the uploaded source, there isn't a file like that there.

Well, not unless it's invisible. I didn't check for that.
 
OK. So @olePigeon is on the right track here.

Your project file is called 'InnectoClassic'. You also have an 'InnectoClassic.rsrc'. You created that, but that's the same name that @olePigeon is talking about above. When the project is built, all the resources from all the resource files in the project end up in this resource file. But you've also added this file to the project. So the build project tries to add all the resources in the file to itself and then complains when the IDs are duplicates, because of course they're duplicates, it's the same file.

Remove the resource file from the project, rename it to something else, readd it.
 
Back
Top