05 August 2020, 23:02 | #1 |
Registered User
Join Date: May 2020
Location: Norwich, CT, USA
Posts: 39
|
Standard C libraries? aka fopen,fread,fwrite
I am using fopen, fread, fwrite in my code which compiles ok using vbcc, but the linker complains I'm missing _open,_read,_write. Anyone know what the missing library is called?\ or where I might find it?
|
06 August 2020, 00:35 | #2 |
Registered User
Join Date: Mar 2019
Location: Poland
Posts: 59
|
It looks like you compile for an embedded system and not AmigaOS.
What is your compilation params provided to vbcc? |
06 August 2020, 08:00 | #3 |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
|
Posixlib. See Aminet.
|
06 August 2020, 11:26 | #4 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
open(), read() and write() are not part of the ISO-C standard, so you cannot expect them to be in a C library, and really portable C code would not use them.
These are Unix system calls and conform to the POSIX standard. Some C libraries emulate them to simplify porting of Unix sources, but vbcc does not. See Hedeon's reply for an alternative. The intention behind that is to enforce clean ISO-C code as much as possible, so you can be sure that a source which compiles with vbcc should compile with any ISO-C compliant compiler. |
06 August 2020, 11:46 | #5 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
OP said he tried using fopen, fread, fwrite. (and got linking errors on _open etc)
I think those are standard lib as of C89. Docent's approach sounds more logical to me. |
06 August 2020, 17:40 | #6 | |
Registered User
Join Date: May 2020
Location: Norwich, CT, USA
Posts: 39
|
Quote:
Here's the makefile: OBJECTS = morale.o move.o report.o gun_fire.o gun_load.o main.o game: $(OBJECTS) vc +aos68k -lvc -O2 -I$(NDK_INC) -o game $(OBJECTS) -lmieee -lauto -lamiga main.o: main.c common.h /lib/ship.h /lib/country.h /lib/guns.h morale.o: morale.c common.h /lib/ship.h /lib/guns.h move.o: move.c common.h /lib/ship.h report.o: report.c common.h /lib/ship.h gun_fire.o: gun_fire.c common.h /lib/ship.h /lib/guns.h gun_load.o: gun_load.c common.h /lib/ship.h /lib/guns.h |
|
06 August 2020, 17:46 | #7 |
Registered User
Join Date: May 2020
Location: Norwich, CT, USA
Posts: 39
|
Yes, this looks like what I am looking for. Will test it out in a while... Edit: yes, this did the trick! Thank you! Last edited by FirstNE; 06 August 2020 at 19:38. |
06 August 2020, 20:25 | #8 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
|
|
07 August 2020, 22:05 | #9 |
Registered User
Join Date: May 2020
Location: Norwich, CT, USA
Posts: 39
|
OK, thanks! Back in the day I used SAS/C so it's an adventure in using vbcc.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with fread while booting game from adf | MacSpain | Coders. General | 5 | 16 May 2020 11:34 |
M68K and libraries | rcman | Coders. Asm / Hardware | 3 | 05 February 2020 21:03 |
Libraries | Syntrax | support.Other | 6 | 31 March 2019 15:59 |
Equivalent libraries from standard c to amiga c | _ThEcRoW | Coders. General | 6 | 14 December 2005 17:01 |
|
|