Welcome, Guest. Please login or register.

Author Topic: Linker issues when making BOOPSI gadget  (Read 2070 times)


0 Members and 1 Guest are viewing this topic.

Offline MinuousTopic starter

Linker issues when making BOOPSI gadget
« on: March 19, 2012, 11:22:14 PM »
Hello all,

I'm in the process of developing a piechart.gadget for ReAction. The only example code I have found is the led.image code from the Developer CD. I'm trying to adapt that code but it doesn't seem to want to link correctly with SAS/C.

In the piechart.c file, there is a prototype:

VOID CallCHook(void);

and it is referred to later on this line:

cl->cl_Dispatcher.h_Entry = (HOOKFUNC) CallCHook;

In classinit.asm, I have:

    XDEF @CallCHook

and later in that file:

    ...code here...

and I am linking like this:

slink FROM classinit.o piechart.o endcode.o LIBRARY LIB:amiga.lib LIB:debug.lib TO piechart.gadget

but SLink refuses to link it, saying that _CallCHook is undefined. I don't know why. I don't know the significance of the prepended @ and _, it is not explained anywhere what these mean. I have tried changing, removing etc. these prepended symbols but it seems not to help.

Offline Steady

Re: Linker issues when making BOOPSI gadget
« Reply #1 on: March 20, 2012, 01:58:18 AM »
I'm not sure what assembler you are using, but C prepends all functions with an underscore, so XDEF _CallCHook should work fine.

Define the function as:

   ... code here ...

Is that still an issue?

Offline MinuousTopic starter

Re: Linker issues when making BOOPSI gadget
« Reply #2 on: March 20, 2012, 05:15:21 AM »
Yes, the assembler in use is the SAS/C assembler.
  Hmm, yes that is linking OK now. I thought I had tried that already, apparently not. Thanks.