My first DeskLib program fails
Glen Walker (2585) 469 posts |
OK, so I thought I’d post this here so anyone else can benefit if the answer is obvious (which I suspect it probably is). I have copied bits out of one of the DeskLib example programs and applied them to my own test program but when I run make I get this in the throwback: Processing:SDFS::HardDisc0.$.Programming.gw0024.v1.c.main Errors in :SDFS::HardDisc0.$.AcornC/C++.!DeskLib.h.Core 37 E differing redefinition of #define macro FALSE 38 E differing redefinition of #define macro TRUE 40 E differing redefinition of #define macro ERROR 62 S type disagreement for 'os_error' 62 E duplicate typedef 'os_error' Errors in :SDFS::HardDisc0.$.AcornC/C++.!DeskLib.h.Wimp 101 S type disagreement for 'wimp_colour' 101 E duplicate typedef 'wimp_colour' 646 S <identifier> expected but found '0' in 'enum' definition Errors in :SDFS::HardDisc0.$.AcornC/C++.!DeskLib.h.WimpSWIs 55 S Expecting <declarator> or <type> but found '262336' 59 S Expecting <declarator> or <type> but found '262365' 61 S Expecting <declarator> or <type> but found '262366' 69 S Expecting <declarator> or <type> but found '262380' 70 S Expecting <declarator> or <type> but found '262385' 76 S Expecting <declarator> or <type> but found '262367' 92 S Expecting <declarator> or <type> but found '262375' 100 S Expecting <declarator> or <type> but found '262361' 101 S Expecting <declarator> or <type> but found '262362' 102 S Expecting <declarator> or <type> but found '262363' 104 S Expecting <declarator> or <type> but found '262337' 105 S Expecting <declarator> or <type> but found '262341' 106 S Expecting <declarator> or <type> but found '262342' 107 S Expecting <declarator> or <type> but found '262339' 109 S Expecting <declarator> or <type> but found '262344' 110 S Expecting <declarator> or <type> but found '262345' 111 S Expecting <declarator> or <type> but found '262346' 113 S Expecting <declarator> or <type> but found '262347' 115 S Expecting <declarator> or <type> but found '262348' 128 S Expecting <declarator> or <type> but found '262368' 129 S Expecting <declarator> or <type> but found '262359' 130 S Expecting <declarator> or <type> but found '262353' 136 S Expecting <declarator> or <type> but found '262338' 137 S Expecting <declarator> or <type> but found '262340' 138 S Expecting <declarator> or <type> but found '262349' 142 S Expecting <declarator> or <type> but found '262350' 145 S Expecting <declarator> or <type> but found '262358' 150 S Expecting <declarator> or <type> but found '262370' 193 E differing redefinition of #define macro Wimp_Poll 194 E differing redefinition of #define macro Wimp_PollIdle 265 S Expecting <declarator> or <type> but found '262351' 266 S Expecting <declarator> or <type> but found '262360' 268 S Expecting <declarator> or <type> but found '262352' 273 S Expecting <declarator> or <type> but found '262354' 274 S Expecting <declarator> or <type> but found '262355' 279 S Expecting <declarator> or <type> but found '262356' 280 S Expecting <declarator> or <type> but found '262376' 281 S Expecting <declarator> or <type> but found '262357' 291 S Expecting <declarator> or <type> but found '262364' 296 S Expecting <declarator> or <type> but found '262371' 297 S Expecting <declarator> or <type> but found '262374' 298 S Expecting <declarator> or <type> but found '262373' 299 S Expecting <declarator> or <type> but found '262372' 300 S Expecting <declarator> or <type> but found '262381' 305 S Expecting <declarator> or <type> but found '262387' 315 S Expecting <declarator> or <type> but found '262378' 317 S Expecting <declarator> or <type> but found '262379' 320 S Expecting <declarator> or <type> but found '262383' Errors in :SDFS::HardDisc0.$.AcornC/C++.!DeskLib.h.KernelSWIs 174 S Expecting <declarator> or <type> but found '35' 203 S Expecting <declarator> or <type> but found '53' 207 S Expecting <declarator> or <type> but found '56' 221 S Expecting <declarator> or <type> but found '57' 234 S Expecting <declarator> or <type> but found '39' 247 S Expecting <declarator> or <type> but found '5' Errors in :SDFS::HardDisc0.$.Programming.gw0024.v1.c.main 58 W variable 'argv' declared but not used 58 W variable 'argc' declared but not used 102 W variable 'message' declared but not used |
Jeffrey Lee (213) 6048 posts |
Looks like either:
The h.WimpSWIs and h.KernelSWIs errors look curious. Can you give examples of what some of those header lines look like? It might give some clues as to what the problem is. |
Glen Walker (2585) 469 posts |
Yep I had a few stray includes for OSLib and SFLib from when I was playing around with Steve Fryatt’s guide to WIMP programming—I was just coming here to update you all but it seems you beat me to it!
Not sure what was going on there—those errors have also disappeared. Now the test application builds OK but I am getting an error that it can’t find a Template—where do I get/create the required template file? |
Rick Murray (539) 13840 posts |
What test application? You can create a Template file using FormEd (does that still exist?), WinEd (http://www.riscos.info/index.php/WinEd), or TemplEd (http://www.rayfavre.me.uk/Downloads/Package/Utils.zip). My preferred is TemplEd. Use anything other than FormEd. ;-) However, you also need to call the function Resource_Initialise() passing the appname as used in the system variable, that is to say if you use MyApp$Dir then it would be “MyApp”. This is different to the application name registered with the Wimp and shown in the task manager. |
Glen Walker (2585) 469 posts |
The one I have written to test myself & learn the system. I borrowed a Templates file from one of the examples and the program builds fine now. Also got a copy of WinEd and it looks interesting. Will give TempEd a try next too! :—) |