How to build Toolbox application using GCC?
Pages: 1 2
Paolo Fabio Zaino (28) 1882 posts |
Andrew McCarthy is correct, if you specify:
in your gcc call then in your code you just need:
btw, looks like I have missed a party here :D CurlLib works fine compiling it with GCC on RISCOS I started a client code to connect to JF-on-line-patches work some times ago and it uses curl and json.c to talk to the service, then I have left it unfinished ’cause I focused on other stuff… but the tests were all working fine. |
Andrew McCarthy (3688) 605 posts |
;-) Almost.
Results in
The following compiles
Questions:
|
Chris Gransden (337) 1207 posts |
You can check what they have been set to with e.g.,
or
|
Ronald (387) 195 posts |
How do you check what paths have been set-up? I imagine |
Fred Graute (114) 645 posts |
You’ll need to edit the ModeFile for C mode. To open the ModeFile click with the right mouse button on StrongED’s iconbar icon. In the menu that opens, click with Shift held down on the ‘C’ entry to load the ModeFile. In the ModeFile locate the ‘Functions’ section, near the end of the file. Within the ‘Functions’ section find the ‘Key’ line for F10. The line below that defines what a ‘Select’ (left mouse button) click on the associated toolbar icon does. It’s also the action carried out when F10 is pressed. You can change the action(s) tied to the ‘Select’ line to suit your needs. It can be a simple command to open a TaskWindow but it could also run a specific (make) file. The ‘Select’ and ‘Adjust’ lines present in the ModeFile should give you some idea of what’s possible. The ‘Run’ function takes a single string as parameter and executes that as a *command so if you know the *command required, binding to F10 should be easy. If you want the current file to be saved first use the ‘SaveRun’ function. When done, click with right mouse button on the ‘Save’ icon on the toolbar. If asked where to save, click on ‘Save to UserPrefs’. Now open a text in C mode and check if pressing F10 has the desired effect. If not, edit the ModeFile some more then save and check again. Hopefully this is clear enough but if you have further questions just ask. |
Paolo Fabio Zaino (28) 1882 posts |
StrongED mode configuration file has pre-defined 8000K wimpslot for GCC which is good for the old gcc, but you can change that value to 16000. However I personally prefer to write a TaskObey file and double click on it to kick start a compilation and use Makefiles to control gcc and or other compilers/linkers and every aspect of the building process…
I do not define myself a veteran… however you can check if specific system variables have been defined in an Obey script and if not rise an error. for instance:
Problem is that Obey doesn’t really work as some may expect and so if the variable above is set everything goes well, but if it’s not set then Obey will throw an Unknown Operand error… Some may want to use some logic there and put the variable between "" (that’s the bash way for example), but in that case Obey will interpret the variable name as a literal value… So the best way I know is to use BBC BASIC as your build management or Lua, for instance create some BBC BASIC checking code you run from your TaskObey:
Hope this helps |
Stuart Swales (1481) 351 posts |
You need If “<OSLib$Path>” = "" THEN … [Edited for single equals in case it’s stumbled on out of context] |
Lothar (3292) 134 posts |
If you would use GCC and TBX you can compile and link under RISC OS e.g. for the provided sample toolbox APP !Graphics g++ -o ^.!RunImage a.libtbx cc.main cc.GraphicsWnd cc.SaveAsSprite |
Paolo Fabio Zaino (28) 1882 posts |
@ Stuart
That kinda work, should be: If "<OSLib$Path>" = "" THEN Obey wants a single “=” not a double “==”, but yes in that specific case it can help, however I have long abandoned to use Obey for this, given the limited scope of the < > syntax. It would be cool if the < > worked in more cases thought. |
Andrew McCarthy (3688) 605 posts |
Excellent. Thank you for all the tips and replies. |
Andrew McCarthy (3688) 605 posts |
My learning C “The Hard Way” and Toolbox journey has led me to this point. Toolbox: Menu → Quit, utilises QUIT_QUIT (&82a91). OSLib provides the following function What, as an easy to understand, minimal set of parameters can I use to enable quit on my app using the Toolbox aspects of OSLib? I recognise that I need a handler function, but I’m struggling with what the bare minimum is, in terms of values for the function event_register_toolbox_hander()? Context. I’m utilising GCC ©, OSLib, OSLibSupport and I have created a bare bones !App which puts an Icon on the IconBar. |
Chris Gransden (337) 1207 posts |
There’s a couple of example apps with source in this topic. https://www.riscosopen.org/forum/forums/5/topics/14713#posts-94420 |
Julie Stamp (8365) 474 posts |
The values you need are
The minus one means you don’t care what object the event comes from (you can use the constant event_ANY from Event.h for that). The handler will be
Please don’t forget to put the action_QUIT_QUIT in the list of actions you pass to toolbox_initialise. |
Andrew McCarthy (3688) 605 posts |
Happy New Year and thank you. I managed to implement QUIT! Thanks also for the referenced examples. Yay! progress… :) |
Pages: 1 2