08 February 2021, 22:28 | #1 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
Noob Question about Library Formats and VBCC
So I'm playing with libcurl https://aminet.net/package/comm/tcp/curl-7.74.0.lha as a way to make https requests on OS3.x. Theres's a simple https.c example that comes with the lib, which I am trying to build with vbcc.
I have a simple VC command line that specifies the include and lib directories for libz, libcurl and amissl-4.7, along with @phx's PosixLib and the 3.9 NDK. All compiles just fine but when I get to linking I get a message saying libamisslauto.a is "format not recognised". Update: removed a bunch of stuff I had written about the Mac "file" utility as it was lying to me. libamisslauto, and libz (which I have definitely built with before) look similar in structure. in a hex editor they both start with "!<arch> __.SYMDEF". libcurl looks different in the hex editor, but its not complaining about that file. I'm a bit new to all this so I'm not clear what to take from this information. VBCC/VLINK clearly doesnt like libamisslauto.a ... is there a way to find out why ? Thanks in advance for any help Alan Last edited by alancfrancis; 08 February 2021 at 22:45. |
08 February 2021, 22:36 | #2 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
|
You forgot the .lha in your link.
vbcc lib format is different from gcc (which this one is) lib format. Not sure if they can be converted from one to the other. I think the vbcc libs end with .lib Last edited by Hedeon; 08 February 2021 at 22:50. |
08 February 2021, 22:44 | #3 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
@Hedeon thanks. Fixed the link. That sucks... so I'd have to build amissl from source using VBCC to get a lib I can use ?
|
09 February 2021, 13:52 | #4 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Dealing with object and library file formats is the job of the linker. vlink, in this case, which supports many different formats. But it wouldn't expect a hunk-format object file in a ".a" linker-lib, for example (although this could be easily added). It's just that vbcc's m68k-amigaos target uses hunk-format object files, defined in its config files. I made this choice because this is the traditional format of all real Amiga compilers and linkers, which provides best compatibility with other Amiga tools. m68k-ataritos is completely different, of course, and uses .a libraries with VOBJ object files. Quote:
ar xv libxyz.aand convert all object files from a.out format to hunk-format, for example: vlink -bamigahunk -r -o hunkobj1.o aoutobj1.o. Then put the objects into an Amiga linker lib: join as xyz.lib hunkobj1.o ... BTW, I got the files from alanfrancis and libamisslauto.a seems corrupt. At least no binutils-ar can list or extract it correctly. libz.a is ok, although a gcc a.out library, but still links with vlink. |
||
11 February 2021, 22:54 | #5 | |
Registered User
Join Date: Aug 2018
Location: United Kingdom
Posts: 198
|
Quote:
|
|
12 February 2021, 18:53 | #6 | |
Registered User
Join Date: Aug 2018
Location: United Kingdom
Posts: 198
|
Quote:
Have now tried using "ar rf" to truncate the name and it seems to work now - see attached fixed libamisslauto.a for 68k in case it is of any help. |
|
13 February 2021, 19:39 | #7 |
Registered User
Join Date: Aug 2018
Location: United Kingdom
Posts: 198
|
FYI, I've tweaked the AmiSSL includes a little to be more compatible with VBCC - it was mainly the missing ssize_t type that was causing problem. I've also added native VBCC support into autoinit_amissl_main.c so that it can be easily recompiled with VBCC (and SAS/C support added back too) into a native link library.
I can now compile the example https.c (I've updated this too) with VBCC with a vanilla install, plus the Roadshow netincludes, for both OS3 and OS4. See https://github.com/jens-maus/amissl/...e481e9071fdd80 for details - these changes will all be included in the next AmiSSL release. |
14 February 2021, 14:32 | #8 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
@futaura @phx Thanks so much for all your help and time. As I said to Frank I've been programming for 30+ years and am betraying an embarrassing lack of knowledge in how the basic tools work. I blame TurboC, BorlandC++, VisualC++, Java, Ruby and Xcode for shielding me from the ins and outs of all this :-). But I'm glad to be getting my hands more dirty now, at least in my hobby project.
|
14 February 2021, 15:15 | #9 | |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 146
|
Quote:
When I couldn't do that, I went down a garden path of trying to understand why the library wasn't working and ended up installing Bebbos GCC toolchain and the whole thing worked out of the box. (yay!) As an over thinker, and someone who's aware you probably get a lot of people complaining about work you do for free, I just wanted to be super clear that I'm in no way bitching about VBCC or AmiSSL, just frustrated when following instructions doesn't work and *I* don't understand enough to guess why. Glad to see that maybe I helped find a bug somewhere by asking idiot questions :-) Alan |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
noob question | Pixelfill | Coders. Asm / Hardware | 7 | 07 February 2020 15:04 |
Noob Question 1: Amiga formats | Peilton | New to Emulation or Amiga scene | 21 | 16 January 2010 22:36 |
Noob question, sorry. | fitzsteve | project.WHDLoad | 3 | 23 August 2009 16:56 |
Noob Question but anyway. | trackah123 | Coders. General | 17 | 30 October 2008 14:39 |
yet another noob question | AliasXZ | New to Emulation or Amiga scene | 11 | 23 January 2008 23:28 |
|
|