Creating a standalone code resource with prc-tools

Discuss topics that apply across the products, such as the PocketC language, or development in general

Postby chrgra on Sat Jul 12, 2003 6:41 am

Here a very short example of creating your own standalone code resource ( native add-in ) with prc-tools / gcc.

-Code size is much smaller than code warrior.
-It's free!
-Think at me. It took me one sleepless week and someway I want revenche for that, because the solution is very very simple.

The procedure

I used the example SampleAddIn packed with orbforms.
I used palmos3.5 als palmos

-Change SampleAddIn.cpp :

Add the line #include <standalone.h> at the top of SampleAddIn.cpp.
Change "__Startup__" to "start".!!!! in SampleAddIn.cpp.

now the compiling,linking and building......

m68k-palmos-gcc -palmos3.5 -o SampleAddIn.a -c SampleAddIn.cpp

m68k-palmos-gcc -palmos3.5 -nostartfiles -O2 -g -Wall -o SampleAddIn.o SampleAddIn.a

m68k-palmos-obj-res SampleAddIn.o

mv code0001.SampleAddIn.o.grc ofNA0000.SampleAddIn.o.grc

build-prc --no-check -o SampleAddIn.prc -n SampleAddIn -t 'CODE' -c 'ChGr' ofNA0000.SampleAddIn.o.grc

copy SampleAddIn.prc c:\progra~1\orbforms\add-ins

that's all folks!

The -t and the -c option in build-prc are arbitrative, you can change them to your own needs.

Regards Chris Gradussen
Posts: 18
Joined: Thu Jul 03, 2003 4:30 pm

Postby Maverick on Fri Oct 12, 2007 10:30 am

I am trying to build a native add-in for OrbForms Designer. I just have a simple add-in. I just blindly followed the above-mentioned steps and gave it a shot.

Code: (myFirstAddin.cpp)
#include <PalmOS.h>
#include <standalone.h>
#include "OrbNative.h"

extern "C" {
void* start(OrbFormsInterface*, void*, UInt16);

void doNothing(OrbFormsInterface* ofi)

void* start(OrbFormsInterface* ofi, void* data, UInt16 iFunc)
switch (iFunc) {
return NULL; // we do not need to setup any global state
return NULL;
case 0:
return NULL;

Code: (myFirstAddin.oc)
int giveNothing() @ library("myFirstAddin", 0);

Steps to build
m68k-palmos-gcc -palmos5r4 -o myFirstAddin.a -c myFirstAddin.cpp
m68k-palmos-gcc -palmos5r4 -nostartfiles -O2 -g -Wall -o myFirstAddin.o myFirstAddin.a
m68k-palmos-obj-res myFirstAddin.o
mv code0001.myFirstAddin.o.grc ofNA0000.myFirstAddin.o.grc
build-prc --no-check -o myFirstAddin.prc -n myFirstAddin -t 'CODE' -c 'myFi' ofNA0000.myFirstAddin.o.grc

When I try to call doNothing from a Orbforms Designer App, I get the following fatal alert.
OrbFormsRT(3.0.4) called sysFatalAlert with the message "vm.cpp, Line:1304, op1->type == vtSavedFP"

Before I try to dig deeper, has anybody built a native add-in for Orbforms Designer using eclipse(Garnet OS devlopment suite) or prc-tools. For pocketC, seems like the add-in is built as a shared library. I tried to build it as a shared library which failed as well.

Further prc-tools documentations says that "m68k-palmos-obj-res" has been deprecated and recommends not to use it. So how does one build a standalone code resource?

I'd appreciate any input in this regard.

Posts: 2
Joined: Fri Oct 12, 2007 10:12 am

Re: Creating a standalone code resource with prc-tools

Postby earlcasper on Fri May 30, 2008 6:29 pm

Percival made this work and posted the complete solution in: Thank you Percival :!:
Posts: 25
Joined: Thu Sep 29, 2005 11:50 pm
Location: USA

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest