Welcome, Guest. Please login or register.

Author Topic: StormC 3.0 linker error  (Read 3304 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
StormC 3.0 linker error
« on: November 13, 2003, 08:28:31 AM »
I'm using StormC 3.0 that came with my developer CD.. I've been using Reaction for a while now, but I'm trying to use LibDoGadgetMethod() .. it compiles with no errors, but gives a linker error at the end.

Linker error: Symbol "_LibDoGadgetMethod" not defined.

I've tried adding the reaction.lib file to my project but that doesnt fix the problem.. Anyone know how to fix this?

Update: with reaction.lib in my project it now says Linker error: symbol "@DoMethodA" not defined - hint (@LibDoGadgetMethod() ) .. and yes, amiga.lib is already in my project as well.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #1 on: November 13, 2003, 11:12:37 AM »
LibDoGadgetMethod() is a Reaction.lib function.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #2 on: November 13, 2003, 11:14:51 AM »
Quote
Can you provide a list of all linked objects in the order they will be linked?


I just use "Add files" to add reaction.lib to my StormC project, I dont know what order they're being linked..
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #3 on: November 14, 2003, 01:42:53 AM »
Quote
LibDoGadgetMethod() in reaction.lib just calls intuition.library/DoGadgetMethod() in reality on systems greater than v39. Since you are programming for Reaction, you should have no problem using the intuition.library version.

If it keeps giving you problems, you may as well save yourself the hassle and use DoGadgetMethod().

I used DoGadgetMethod() in my own Reaction programs with no problems.


Can you tell me how to use LBM_SORT and LBM_REMNODE with DoGadgetMethod() ?  I'm having trouble working it out..

DoGadgetMethod(listbrowser2, win, NULL, LBM_SORT, 1, TAG_DONE); Doesnt seem to work.. compiles fine but it doesnt sort my list..

-Edit- I've worked out LBM_REMNODE, but I'm not sure what they mean in LBM_SORT...

(pasted from the listbrowser header file)

struct lbSort
{
   ULONG MethodID;               /* LBM_SORT */
   struct GadgetInfo *lbs_GInfo;   /* to provide rendering info */
   ULONG lbs_Column;            /* Column to sort by */
   ULONG lbs_Reverse;            /* Reverse sort */
   struct Hook *lbs_CompareHook;   /* Optional hook to compare items */
};

What do I put for Column? listbrowser2 has only got
one column.. so '0' should sort that column? i.e.

DoGadgetMethod(listbrowser2, win, NULL, LBM_SORT, listbrowser2, 0, TAG_DONE);  .. ?
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #4 on: November 17, 2003, 08:41:09 AM »
Quote
There doesn't seem to be a lot of information on the LBN_SORT method at all.
However, it seems that you are supplying the pointer to the gadget for the lbs_GInfo field when it needs to be a GadgetInfo structure.

Well look at the remnode info..

struct lbRemNode
{
    ULONG MethodID;                    /* LBM_REMNODE */
    struct GadgetInfo *lbr_GInfo;    /* to provide rendering info */
    struct Node *lbr_Node;            /* Remove() this node */
};

And I use it in my program like this:

DoGadgetMethod(listbrowser2, win, NULL, LBM_REMNODE, listbrowser2, node2, TAG_DONE);

And it works.. so supplying gadget pointers where it wants GadgetInfo structs or whatever should work. I'm a bit of a newbie programmer, but yeah...

Quote
I couldn't find the info to confirm it, but I reckon you are most likely right in passing 0 as the lbs_Column argument.

I really want to get this fixed. My program needs some kind of sorting....... I dont want to write a custom sorting function.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #5 on: November 17, 2003, 08:42:41 AM »
Quote
Hmm, IIRC Reaction.lib doesn't work properly with StormC, as it's written with SAS C in mind.
I use StormC 3 myself and have never used Reaction.lib in my (pityful) ReAction based projects.

pitful eh.. hehe what are you working on? I like hearing about other peoples projects.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #6 on: November 17, 2003, 09:13:59 AM »
I've sorted it out!!!! literally! Check out the following info from the listbrowser autodoc:

Quote

        LISTBROWSER_ColumnInfo (struct ColumnInfo *)
            Provides the column layout info for the list browser.  This is
            an array of struct ColumnInfo.  The array must have one entry
            per column, plus one terminating entry where the ci_Width field
            is -1.  Each field in an array entry is filled in as follows:

                ci_Width (WORD)
                This specifies the percentage of the view width you want the
                column to be.  If a virtual width is given, this will be a
                percentage of that, otherwise it will be a percentage of the
                actual gadget width.  Since you are specifying a percentage,
                the actual size of the column will automatically adjust as the
                virtual or actual width of the gadget changes.

                ci_Title (STRPTR)
                If you have specified LISTBROWSER_ColumnTitles, TRUE then
                you MUST fill in the titles you wish to appear for each column
                here.

                ci_Flags (ULONG)
                Flags for the column, suported by V42 and later only.

                     CIF_WEIGHTED -- weighted width column (default)
                     CIF_FIXED -- fixed pixel width specided in ci_Width.
                     CIF_DRAGGABLE -- separator is user draggable.
                     CIF_NOSEPARATORS -- no separator on this column.
                     CIF_SORTABLE -- column is sortable.


So I just had to add the CIF_SORTABLE flag to my column struct, and the sort function now actually works!

struct ColumnInfo ci1[] =
{
    { 500, NULL, CIF_SORTABLE },
    { -1, (STRPTR)~0, -1 }
};

DoGadgetMethod(listbrowser2, win, NULL, LBM_SORT, listbrowser2, 0, FALSE, TAG_DONE);



I'm happy. Thanks for your help guys.