31 May 2024, 22:24 | #1 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
Compiling against bsdsocket in C
I'm writing a socket server in C using vbcc (in WinUAE) and it doesn't link against the static libraries from AmiTCP. If I add the -vv option, I see the following:
Quote:
There are two possible outcomes I suspect I am looking for:
Files used: |
|
01 June 2024, 09:24 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,032
|
I cannot help you with AmiTCP. But it is ancient. Try Roadshow SDK instead.
And what do you need static libs for? I never even bothered. But I am not a power user, I only ever wrote simple http clients. |
01 June 2024, 21:53 | #3 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
I've not programmed in non-assembly on the Amiga before. What is the alternative to static libs? Inline header asm stubs?
|
01 June 2024, 23:21 | #4 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,032
|
You are using vbcc. Just #include <proto/bsdsocket.h> and you are done. No need to link against any net lib.
|
01 June 2024, 23:35 | #5 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
Thanks. This fails due to a missing file 'clib/bsdsocket_protos.h' which is clearly another problem with the AmiTCP SDK. I'll get rid of it and replace it with Roadshow which you've kindly pointed me in the direction of.
|
01 June 2024, 23:53 | #6 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,047
|
I think the posixlib for vbcc also has bsdsocket stuff?
|
02 June 2024, 00:46 | #7 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
That's a good tip Hedeon but it's unclear how useful this is. It refers to only opening bsdsocket.library when needed, but the perhaps unstated goal here is that the whole point is that bsdsocket.library is used. This is because WinUAE provides it and it allows a form of external communication.
|
09 June 2024, 13:20 | #8 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,551
|
The network stuff is confusing with AmigaOS. Main problem here is: although AmiTCP and Roadshow both name their shared library
bsdsocket.librarythe header files in their SDK are named differently. It is either <proto/socket.h>(from vbcc) and <clib/socket_protos.h(from AmiTCP SDK) or <proto/bsdsocket.h>(from vbcc) and <clib/bsdsocket_protos.h>(from Roadshow SDK). So in this case (AmiTCP) including <proto/socket.h>might have helped. As Thomas indicated, linking with any static libraries from the AmiTCP SDK is rarely required, if you include the proto header, because that automatically includes the inline-calls from <inline/socket_protos.h>. The reason for the "corrupted file format" error is unclear. I couldn't reproduce it. But maybe the vlink used is just too old. The libraries in the AmiTCP-SDK are in SAS/C HUNK_LIBformat, which vlink only supports since V15. Also note that you have to be careful with the Include path from the AmiTCP-SDK. It overwrites compiler-specific standard headers like stdio.hand errno.h, which you must avoid. Solution for vbcc is to force reading from the standard include path before the AmiTCP-SDK include path. For example: -Ivincludeos3: -IAmiTCP/netinclude As far as I remember this situation improved with Roadshow. |
09 June 2024, 21:56 | #9 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
Thanks, it sounds like upgrading to the non-aminet version of vbcc/vlink is the way to go. I do have the amitcp headers last though, so that problem was avoided from the get go fortunately.
|
13 June 2024, 08:20 | #10 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 681
|
Quote:
|
|
13 June 2024, 10:54 | #11 |
Registered User
Join Date: Jan 2005
Location: UmeƄ
Age: 44
Posts: 936
|
Yes and the Roadshow SDK works great even if you end up using AmiTCP or Miami as it is the same bsdsocket.library API. I only use the Roadshow SDK since a long time. I only use the proto files and do not link against any library.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
bsdsocket enabled? | davethemackem | support.WinUAE | 2 | 03 November 2022 14:29 |
BSDSocket SocketBaseTagList() | flype | support.WinUAE | 10 | 05 October 2020 21:13 |
bsdsocket missing | source | support.WinUAE | 3 | 23 June 2013 14:48 |
bsdsocket slowdown | amigan | support.WinUAE | 0 | 20 January 2004 12:37 |
bsdsocket problem | KurZon | support.WinUAE | 1 | 05 May 2003 10:42 |
|
|