19 June 2024, 16:06 | #1 |
Registered User
Join Date: Mar 2016
Location: Thun / Switzerland
Posts: 62
|
Problem Loading Library
Hi Amiga Coders
Trying to use some Math Libraries. The expected result from the test code below would be an endless loop when the library was loaded. This doesn't work however. I get straight back to console. I'm running this against a vanilla Amiga 1200 Configuration in the Emulator with nothing installed. It's compiled using the Vscode Plugin from Abyss. If I remove MathIeeeSingBasBase= (structMathIEEEBase*) OpenLibrary((CONST_STRPTR)"mathieeesingbas.library", 0); if (!MathIeeeSingBasBase) Exit(0); I'm getting the Endless loop. So I believe that's where the code fails. Any Ideas? SysBase=*((structExecBase**)4UL); custom= (structCustom*)0xdff000; // We will use the graphics library only to locate and restore the system copper list once we are through. GfxBase= (structGfxBase*)OpenLibrary((CONST_STRPTR)"graphics.library",0); if (!GfxBase) Exit(0); // used for printing DOSBase= (structDosLibrary*)OpenLibrary((CONST_STRPTR)"dos.library", 0); if (!DOSBase) Exit(0); MathIeeeSingBasBase= (structMathIEEEBase*) OpenLibrary((CONST_STRPTR)"mathieeesingbas.library", 0); if (!MathIeeeSingBasBase) Exit(0); while (TRUE) { /* code */ } CloseLibrary((structLibrary*)DOSBase); CloseLibrary((structLibrary*)GfxBase); |
19 June 2024, 16:31 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,095
|
This is a ROM library, so... here comes a blink kick ><.
It's not opened automatically during boot etc., so maybe out of memory? How much is left after you've started your program? |
19 June 2024, 16:50 | #3 |
Registered User
Join Date: Mar 2016
Location: Thun / Switzerland
Posts: 62
|
This is basically all my program is doing. There's a main loop around it but that's it.
|
19 June 2024, 17:11 | #4 |
Coder/webmaster/gamer
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,711
|
Does this compiler use 16-bit ints? That would explain the problem if so.
Last edited by Minuous; 19 June 2024 at 17:17. |
19 June 2024, 17:15 | #5 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,095
|
Post exe? I'm not sure what else could go wrong (it's C and not asm, so who knows).
AFAIK load order is memory first, then disk. Thinking about having a disk based library with the same name that requires an FPU and thus fails to load/init. The one in ROM 3.x should handle FPU and no FPU scenario. Do you have any tool/app that uses that library, and if so does it also fail to start? In winuae debugger (shift-F12), you can use Tl command to get a list of currently loaded libraries. Does it eventually show up there? |
19 June 2024, 17:21 | #6 |
Registered User
Join Date: Mar 2016
Location: Thun / Switzerland
Posts: 62
|
It's gcc. I think the frameworks using it's own version. I'm not exactly sure where the framework stores the executable for the compiler.
|
19 June 2024, 17:24 | #7 |
Registered User
Join Date: Mar 2016
Location: Thun / Switzerland
Posts: 62
|
Just noticed I made a stupid mistake. I changed my example before posting it. The one above worked.
The issue is with mathieeetransbase. Below example immediately returns to shell int main() { SysBase = *((struct ExecBase**)4UL); custom = (struct Custom*)0xdff000; // We will use the graphics library only to locate and restore the system copper list once we are through. GfxBase = (struct GfxBase *)OpenLibrary((CONST_STRPTR)"graphics.library",0); if (!GfxBase) Exit(0); // used for printing DOSBase = (struct DosLibrary*)OpenLibrary((CONST_STRPTR)"dos.library", 0); if (!DOSBase) Exit(0); MathIeeeSingBasBase = (struct MathIEEEBase *) OpenLibrary((CONST_STRPTR)"mathieeesingbas.library", 0); if (!MathIeeeSingBasBase) Exit(0); MathIeeeSingTransBase = (struct MathIEEEBase *) OpenLibrary("mathieeesingtrans.library",37); if (!MathIeeeSingTransBase) Exit(0); while (TRUE) { /* code */ } CloseLibrary((struct Library*)DOSBase); CloseLibrary((struct Library*)GfxBase); } |
19 June 2024, 17:35 | #8 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,095
|
That library is always disk based, so it should be present in LIBS:.
|
19 June 2024, 17:54 | #9 |
Registered User
Join Date: Mar 2016
Location: Thun / Switzerland
Posts: 62
|
So mathieeesingtrans.library is disk based. That definitely explains it. As it's part of the OS I can expect it to be there on a HD Based System?
|
19 June 2024, 18:01 | #10 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,490
|
Note that your resource management is flaky. It is not correct to call exit if opening one of the libraries failed to open. You also need to close all those libraries you could open so far. Mathieeesingtrans is in LIBS: on harddisk-based installations, yes.
|
19 June 2024, 23:19 | #11 |
Registered User
Join Date: Sep 2022
Location: Switzerland
Posts: 121
|
and it would be nice if an (helpful!) error message would be printed...
|
24 June 2024, 15:48 | #12 | |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 546
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why isn't my A2000 loading Janus.library? (A2286 board) | klokwirk | support.AmigaOS | 34 | 01 August 2023 20:27 |
A500/Vampire/Coffin/SDNet - bsdsocket.library loading issues | LimpingNinja | New to Emulation or Amiga scene | 0 | 13 March 2020 10:47 |
Library for loading graphics | sparhawk | Coders. General | 2 | 07 March 2020 20:38 |
OS41FE Loading Problem | Saghalie | support.WinUAE | 3 | 15 October 2016 23:16 |
Problem with 'damage' loading | Mad Mark | support.Games | 1 | 23 March 2002 18:40 |
|
|