Welcome, Guest. Please login or register.

Author Topic: Need help compiling Reaction examples with GCC  (Read 2034 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
Need help compiling Reaction examples with GCC
« on: June 27, 2003, 06:12:50 AM »
I'm trying to compile the Reaction examples that were included in the 3.9 NDK. I'm using GCC 2.95.3.. these are the errors I get on the listbrowser example:

5.dh2:NDK_3.9/Examples/Reaction/ListBrowser> g++ test.cpp
test.cpp:112: warning: initialization of negative value `-1' to `ULONG'
test.cpp:118: warning: initialization of negative value `-1' to `ULONG'
test.cpp: In function `int main()':
test.cpp:189: warning: negative value `-1' passed as argument 3 of `AddGList(Window *, Gadget *, long unsigned int, long int, Requester *)'
/t/cc0z7FsB.o(.text+0x57e): undefined reference to `LISTBROWSER_GetClass'
/t/cc0z7FsB.o(.text+0x8ba): undefined reference to `LABEL_GetClass'
/t/cc0z7FsB.o(.text+0x914): undefined reference to `LABEL_GetClass'
/t/cc0z7FsB.o(.text+0x954): undefined reference to `AllocListBrowserNode'
/t/cc0z7FsB.o(.text+0x99e): undefined reference to `AllocListBrowserNode'
/t/cc0z7FsB.o(.text+0xa48): undefined reference to `FreeListBrowserNode'
/t/cc0z7FsB.o(.text+0xa54): undefined reference to `FreeListBrowserNode'
/t/cc0z7FsB.o(.text+0xd74): undefined reference to `AllocListBrowserNode'
/t/cc0z7FsB.o(.text+0xdd6): undefined reference to `FreeListBrowserNode'
/gg/lib/libamiga.a(lockpubscreen.o)(.text+0x4): undefined reference to `IntuitionBase'
/gg/lib/libamiga.a(openwindowtags.)(.text+0x4): undefined reference to `IntuitionBase'
/gg/lib/libamiga.a(newobject.o)(.text+0x6): undefined reference to `IntuitionBase'
/gg/lib/libamiga.a(addglist.o)(.text+0x6): undefined reference to `IntuitionBase'
/gg/lib/libamiga.a(refreshglist.o)(.text+0x6): undefined reference to `IntuitionBase'
/gg/lib/libamiga.a(setwindowtitles.o)(.text+0x6): more undefined references to `IntuitionBase' follow
collect2: ld returned 1 exit status


.. What do I need to do to get this to work? I'm a bit of a programming newbie, so please excuse my ignorance.
 

Offline Mr_Capehill

  • Full Member
  • ***
  • Join Date: May 2002
  • Posts: 189
    • Show only replies by Mr_Capehill
Re: Need help compiling Reaction examples with GCC
« Reply #1 on: June 27, 2003, 06:57:32 AM »
Did you use fd2pragma to create correct headers, and include protos?

Warnings: you can't put -1 to an unasigned variable.

BTW: if you are compiling only C program, 'gc' should be enough.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Need help compiling Reaction examples with GCC
« Reply #2 on: June 27, 2003, 07:34:48 AM »
Quote
Did you use fd2pragma to create correct headers, and include protos?

Yes.

-Edit- the example compiles perfectly in stormc 3.0 , however I want to use GCC so that my stuff will recompile easily for OS 4.0.
 

Offline Highflyer

  • Newbie
  • *
  • Join Date: Mar 2002
  • Posts: 14
    • Show only replies by Highflyer
Re: Need help compiling Reaction examples with GCC
« Reply #3 on: June 27, 2003, 08:32:01 AM »
Quote

-Edit- the example compiles perfectly in stormc 3.0 , however I want to use GCC so that my stuff will recompile easily for OS 4.0.


Stormc opens the various libraries automatically. For gcc, did you add -lauto when compiling?
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Need help compiling Reaction examples with GCC
« Reply #4 on: June 27, 2003, 08:46:16 AM »
/gg/m68k-amigaos/bin/ld: cannot open -lauto: No such file or directory

doesnt seem to work.. g++ -lauto test.cpp or g++ test.cpp -lauto  .. or gcc with those combinations.

 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Need help compiling Reaction examples with GCC
« Reply #5 on: June 27, 2003, 08:48:02 AM »
If there are no solutions to this problem by the time I wake up tommorow morning, I will just use stormc. I'll just have to worry about porting to OS 4.0 when their dev kit comes out. It should be fully setup with reaction etc. I'm not being negative, I just want to start experimenting and achieving. :)

Thanks for your help so far guys.

-Edit- I couldnt wait till morning, I'm using stormc!! thanks anyway people.
 

Offline Highflyer

  • Newbie
  • *
  • Join Date: Mar 2002
  • Posts: 14
    • Show only replies by Highflyer
Re: Need help compiling Reaction examples with GCC
« Reply #6 on: June 27, 2003, 02:13:42 PM »
Quote

-Edit- I couldnt wait till morning, I'm using stormc!! thanks anyway people.


Just in case you or someone else is interested: where is the libauto.a? The trick with gcc is that the names of the libraries don't match the way you call them (libamiga.a is -lamiga etc)
I had the same errors when switching from stormc to gcc, and -lauto solved the undefined references. For the type conversion, I remember that's because stormc is doing some of the work and with gcc you've got to be more explicit (check the autodocs or other sources compilable with gcc).
In the end I succeeded compiling reaction with gcc.
 

Offline kiasanth

  • Newbie
  • *
  • Join Date: Sep 2003
  • Posts: 7
    • Show only replies by kiasanth
    • http://kiasanth.digitalrice.com/
Re: Need help compiling Reaction examples with GCC
« Reply #7 on: September 10, 2003, 12:34:40 PM »
Assuming you've used fd2Pragma to make new includes you have to also use a different link library for reactionlib.a as the one that is supplied with the NDK only works on Storm C. you can get a replacement for reaction.lib at http://translate.google.com/translate?sourceid=navclient-menuext&hl=en&u=http%3A%2F%2Fwww%2Eguru%2Dmeditation%2Enet%2Fmain%2Ephp3%3Fnewsid%3D115 I've included the google translator in the URL so you know what it's talking about. I'm not sure but you may have to convert that lib as well using hunk2aout which is on aminet if you don't have it with your GCC distro.

-edit-

http://www.guru-meditation.net/main.php3?newsid=115       that's the address without translation
 

Offline kiasanth

  • Newbie
  • *
  • Join Date: Sep 2003
  • Posts: 7
    • Show only replies by kiasanth
    • http://kiasanth.digitalrice.com/
Re: Need help compiling Reaction examples with GCC
« Reply #8 on: September 10, 2003, 12:41:23 PM »
Wow, I only just realised it was you Fibbles. and it's too late as I know you already converted to stormC ages ago. meanwhile, if it still matters you also have to declare IntuitionBase and open and close it (Well, That's what I did and it compiled)