Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • 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 Steady

Re: StormC 3.0 linker error
« Reply #1 on: November 13, 2003, 10:27:46 AM »
Hi jahc,

   DoMethodA is defined in amiga.lib, but it is included for linking as you say. Perhaps you are having trouble in the order things are being linked. Can you provide a list of all linked objects in the order they will be linked?

Also, what is _LibDoGadgetMethod? Is that a function in your program?
 

Offline Steady

Re: StormC 3.0 linker error
« Reply #2 on: November 13, 2003, 10:34:02 AM »
I just had a thought. The reason LibDoGadgetMethod() doesn't ring a bell is because it is called simply DoGadgetMethod(). Try that.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #3 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 only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #4 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 PiR

  • Full Member
  • ***
  • Join Date: Apr 2003
  • Posts: 148
    • Show only replies by PiR
Re: StormC 3.0 linker error
« Reply #5 on: November 13, 2003, 12:03:09 PM »
Hi

I think you're missing some #pragmas
It looks like compiler generates the standard call for DoGadgetMethod and then it tries to locate it somewhere.
However if this is .library function it should generate different assembler instruction, that should stop the linker complaining.

As an example look at the exec functions:
They're declared as regular functions, but they also have their #pragma entries.

Good luck

 

Offline Steady

Re: StormC 3.0 linker error
« Reply #6 on: November 13, 2003, 01:53:06 PM »
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.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #7 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 Steady

Re: StormC 3.0 linker error
« Reply #8 on: November 16, 2003, 03:45:37 PM »
Hi jahc,

   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.

Either that, or you are supplying the GadgetInfo structure as the first argument to DoGadgetMethod() when you actually need to supply a pointer to the ListBrowser gadget object. The wrong information being supplied to one (or both) of these parameters is likely to be causing you some trouble.

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.
 

Offline Monoxyde

  • Newbie
  • *
  • Join Date: Nov 2003
  • Posts: 10
    • Show only replies by Monoxyde
Re: StormC 3.0 linker error
« Reply #9 on: November 16, 2003, 04:04:39 PM »
Quote

jahc wrote:
LibDoGadgetMethod() is a Reaction.lib function.


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.

By the way, I really like the IDE supplied with StormC. I don't look forward to the day I must switch to gcc. It's a shame H&P has withdrawn from the Amiga market (ok, some will disagree with this), as I'd love a version for the the new AOS.
Guess I'll check out GoldEd when I get my brand new Miggy.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #10 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 only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #11 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 only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: StormC 3.0 linker error
« Reply #12 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.
 

Offline Monoxyde

  • Newbie
  • *
  • Join Date: Nov 2003
  • Posts: 10
    • Show only replies by Monoxyde
Re: StormC 3.0 linker error
« Reply #13 on: November 18, 2003, 02:03:35 PM »
Quote

jahc wrote:
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.


Sorry for the long reply time. I've only got Internet connection at work, and only when my boss is looking the other way ;-)
As for my projects, it's not anything exciting. Mostly OpenGL stuff (StormMesa) just for the learning experience. I've recently started writing a satellite tracking app (not OpenGL), but I know too little about Amiga specific programming (yet). Although GUI creation is a tad easier on Amiga than on Windows, it still takes too long (at least for me). I'd really like to see a GUI that's as easy to code AmigaE's EasyGUI  (if anybody remembers that).
And I'd really appreciate a good guide on Amiga specific programming (sound, devices, graphics etc).