20 October 2014, 00:03 | #1 |
Registered User
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 52
Posts: 204
|
gcc .lib
I have gotten my project to compile with GCC (was using SAS/C) but I can't get it to link the reaction.lib. How do I do this from shell and makefile.
|
20 October 2014, 00:49 | #2 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
on the shell, did you tried this: gcc code.c reaction.lib -o code.exe ?
in the makefile just add reaction.lib at the end of the lines with your files to be compiled. may work, maybe not edit: post your makefile and some error messages. may help to find a solution. |
20 October 2014, 11:04 | #3 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
IIRC gcc does not like .lib files, it needs .a files instead. There should be a libtoa program somewhere, probably coming with gcc.
Anyway, what is in reaction.lib you cannot work around? |
20 October 2014, 17:06 | #4 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
thomas is right, but wrong tool name - read full article here:
Quote:
|
|
20 October 2014, 17:23 | #5 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
When you've converted from .lib to .a format, use
-lreactionto link with Reaction. GCC (or LD) will look for "libreaction.a" in the default library directories, which are usually hard-coded into GCC, but you can specify additional directories with -Lsome:path/ |
20 October 2014, 18:49 | #6 |
Registered User
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 52
Posts: 204
|
I have to link the reaction.lib for these functions:
ChooserLabels(), FreeChooserLabels(), GetAttrs() If there is a way to not use the lib, that would be great. |
20 October 2014, 20:01 | #7 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
the hunk2aout doesnt work here with reaction.lib. but on amiga.org i found a hint to a replacement for reaction.lib:
Stephan Rupprecht PD Software - reactionlib.lha 12K 03-04-03 reaction.lib replacement your three functions are listed, so this may work. give it a try. Last edited by emufan; 20 October 2014 at 20:10. |
21 October 2014, 11:23 | #8 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Theoretically you can use vlink to convert from any supported format to another. But it is recommended to split all the modules from reaction.lib into single object files first.
Otherwise you can get a single module with all functions from reaction.lib converted to a.out format like this: Code:
vlink -baoutsun020 -Bforcearchive -r -o reaction.o reaction.lib |
21 October 2014, 21:22 | #9 |
Registered User
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 52
Posts: 204
|
I am at work and have not tried anything yet. Keep the posts coming, please.
What I don't understand is that if it is this "big of a deal" to link reaction.lib with GCC, why is there no reference to it in SDK? Why isn't there a converted lib already in there? GCC is the preferred compiler for OS4.x. How is everyone else linking the lib? Or is it just an OS3.x issue? Hopefully I will get a chance to try some ideas out tonight. |
22 October 2014, 00:52 | #10 |
Registered User
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 52
Posts: 204
|
I had the bright idea of compiling the source myself, using SAS/C on OS3.9, and not link the original lib, from Stephan Rupprecht's source above. The window opens, gadgets laid out, won't respond to any input.
From what I can tell this call Code:
GetAttrs(Objects[OID_WINDOW], WINDOW_SigMask, &SignalsMask, TAG_DONE); Last edited by mritter0; 22 October 2014 at 00:58. |
27 November 2014, 19:48 | #11 |
Registered User
Join Date: Sep 2013
Location: Bettendorf, IA, USA
Age: 52
Posts: 204
|
I tried this again today.....same problem. First call of any function in the "lib" freezes execution.
It was intended for VBCC and GCC. I am using SAS/C. Some conflict maybe? |
28 November 2014, 13:00 | #12 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Quote:
|
||
25 October 2018, 14:33 | #13 |
Registered User
Join Date: Jul 2008
Location: Samsun / Turkey
Posts: 66
|
Four years and no proggress on this? What a shame! I think we should solve this for all... so here we go!
I was preparing platform independent cross-compiler "HelloWorld" templates for the next update of my Atom package and realized that I can't compile my reaction HelloWorld for OS3 target because a reaction linker was missing for gcc. After some search I found out that this happens to be the only forum thread on the web about this problem. Before we start thanks to mritter0 for the thread and all the repliers for all the valuable information. Firstly what does not work: - hunk2aout on reaction.lib does not work (no objects are extracted) - vlink -baoutsun020 -Bforcearchive -r -o reaction.o reaction.lib seems to work fine but when you try compile your code it crashes the ld. Here's what I did: - I've downloaded the reaction.lib replacement by Stephan Rupprecht (as emufan mentioned above). - Opened the c source on my IDE and enabled the auto init section: Code:
#if 0 /* Enable it, if you need the autoinit code (some are opened by the default init code)! */ Code:
libs[] = { {(STRPTR)"window.class", 40L, &WindowBase}, {(STRPTR)"requester.class", 42L, &RequesterBase}, ... {(STRPTR)"images/glyph.image", 40L, &GlyphBase} }; Code:
m68k-amigaos-gcc -c -Os reactionlib.c - Then I packed the object with ar: Code:
m68k-amigaos-ar rs libreaction.a libreaction.o - Compiled my HelloWorld code with -noixemul -lamiga -lreaction flags and found out the executable freezes at the first call to any reaction function (just as mritter0 mentioned). But I recognized this kind of freeze from previous experience. Amiga freezes just like this when you mistakingly call a function from a library before opening it. Where do the reaction libraries get opened then? I suppose OS4 startup code does it automatically, but where do our OS3 code opens them? Nowhere! Looking back at the reaction.lib code, I realized that Stephan Rupprecht supplied two functions which open and close reaction libraries: INIT_3_ReActionLibs() EXIT_3_ReActionLibs() Since my code tries to be platform independent I've added them to my code as below: at the top of my buildGUI() function: Code:
#ifndef __amigaos4__ INIT_3_ReActionLibs(); #endif Code:
#ifndef __amigaos4__ EXIT_3_ReActionLibs(); #endif NOTE: These calls would be nicer in a custom startup code but in my case it will complicate things much so I'll stick to linking with -lamiga.a. NOTE2: I'm new in Amiga coding so any further advice on this is highly appreciated. Thanks for reading. Last edited by alpyre; 10 February 2019 at 12:39. |
27 October 2018, 02:13 | #14 |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
|
Cool, great work
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
debugging session with exec lib | pixel | Coders. Asm / Hardware | 4 | 20 May 2014 23:49 |
Help Creating a Graphics Lib View | bodhi | Coders. System | 11 | 15 January 2014 20:49 |
060 processor lib's and OS 3.9 | videofx | support.Hardware | 9 | 01 August 2013 09:29 |
Easynet and bsdsocket.lib Prob | twizzle | support.Apps | 1 | 31 July 2009 05:43 |
Xadmaster lib registration | Rod_cl | support.Apps | 4 | 24 August 2007 00:34 |
|
|