English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 18 February 2022, 19:29   #1
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Getting VBCC, Roadshow, and Posix to Play Together

Hi all!

So far, I have been compiling AmiModRadio against the Miami SDK just fine .

I'd like to replace the Miami SDK with the Roadshow one, which last version (?) I found here. Naively , I thought that it would be a simple matter of changing the compiler/linker options to point to the new SDK... Alas! I have the same problem as walkero-gr (see bottom of the page, although I'm not using AmiSSL): file 'inline/bsdsocket_protos.h' not found. I have also read this and that posts, but I'm still confused

Here are the options that I'm currently using:

Code:
-lmieee
-cpp-comments
-c99
-Idevkits:sdk/classic/MUI/Developer/C/Include/
-Idevkits:sdk/classic/MiamiSDK/netinclude/
-IDevKits:sdk/classic/xad/Include/C/
-IDevKits:compilers/vbcc/0.9g/posixlib/include/
-Lvbcc:posixlib/lib/
-Lvbcc:targets/m68k-amigaos/lib/
-lamiga
-lposix
Is it possible to have both Posix and Roadshow together with VBCC? Certainly... but what should I change?

Thanks in advance!

Last edited by tygre; 19 February 2022 at 00:26.
tygre is offline  
Old 19 February 2022, 02:17   #2
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
PosixLib is meant for porting Unix sources more easily. AmiModRadio is an Amiga program, so I don't understand why there are any references to POSIX functions in it. You may take the chance to replace them by AmigaOS calls now, and then you already have one big problem less.

PosixLib and AmiTCP/Roadshow don't harmonize together very well. Therefore I added most network functions to PosixLib (sys/socket.h), which will open bsdsocket.library for you.

Regarding Roadshow I have to admit that I never saw the SDK before (thanks for the link!). Always thought that it is 100% compatible to AmiTCP. But it looks like the proto and clib headers are called "bsdsocket" instead of "socket".

I will make sure vbcc includes Roadshow support with the upcoming V0.9h release. For older versions you have to generate the inline (and proto?) header files yourself, like mentioned here: https://eab.abime.net/showpost.php?p...07&postcount=6

Using the SFD file from the Roadshow SDK this would be:
Code:
fd2pragma special 70 voidbase to path_to/inline RoadShow_SDK/sfd/bsdsocket_lib.sfd
phx is offline  
Old 19 February 2022, 08:52   #3
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by phx View Post
...


Regarding Roadshow I have to admit that I never saw the SDK before (thanks for the link!). Always thought that it is 100% compatible to AmiTCP. But it looks like the proto and clib headers are called "bsdsocket" instead of "socket".
...
Roadshow provides socket.h headers which include bsdsocket.h.


The SDK does not matter, at least for the resulting program. For the code there are some differences.
bebbo is offline  
Old 19 February 2022, 11:46   #4
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by bebbo View Post
Roadshow provides socket.h headers which include bsdsocket.h.
Indeed. And the base is still
SocketBase
. It was probably too late last night.

Then Tygre can include the existing
<proto/socket.h>
header and should be fine, as long as no Roadshow-specific functions are needed.

EDIT: Had a closer look on the Roadshow SDK this weekend, and the netinclude folder is missing most POSIX headers, like sys/types.h, unitstd.h, etc.. So this might have been the reason for PosixLib. Better use the AmiTCP SDK with vbcc.

Last edited by phx; 20 February 2022 at 13:50. Reason: Roadshow SDK
phx is offline  
Old 21 February 2022, 19:41   #5
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi PHX and Bebbo!

Thank you so much for your answers, you were right and helped me a lot! I managed to create the bsdsocket_protos.h and compile AmiModRadio against Roadshow. I also remove (most) dependencies to the POSIX library.

(I still use some POSIX functions, out of sheer lazyness , like opendir(), readdir(), and scandir()... I will replace them with AmigaOS Examine and ExAll later )

The reason why I wanted to compile against Roadshow is that it allows declaring NOLIBBASE and replace a global SocketBase variable with a per-task SocketBase, thank you AROS developers! Thus, multiple tasks can open and use sockets like, for AmiModRadio, fetching a module while rating another one. Fetching and rating at the same time used to create problems (leading often to crashes), but not anymore! The real reason is, of course, that I should have RTFMed from the beginning: "The recommended approach, if several Processes need to use the "bsdsocket.library" functions, is to reopen the library for every user." (Autodocs on OpenLibrary).

Cheers!
tygre is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting VBCC and Enforcer to Play Together tygre Coders. C/C++ 28 21 February 2022 20:58
Info Ade Posix vs Vbcc Posix Library Zilog Coders. General 2 28 August 2020 13:07
Setting up Roadshow SDK with VBCC stevelord Coders. C/C++ 14 24 June 2020 17:37
Casual Play & Serious Play Amiga Setups ransom1122 Retrogaming General Discussion 3 20 October 2015 21:35
SCSI bridging between Intuition and POSIX compliant OSes aphrogen Coders. General 1 09 June 2002 21:29

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:14.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06897 seconds with 13 queries