15 March 2013, 08:51 | #1 |
Zone Friend
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
|
C Code without official includes
Hi coders.
How would I go about doing a basic Hello world with out using the official includes, is there a way to do it like you can in Assembler? Putting all the system calls in a different header file or at the top of the source, so other people can compile it with the freeware version of Dice. OpenLibrary(),CloseLibrary(),Output(),Write() ?? Any tips would be much apreciated. I would like to be able to call different ROM functions via C, I know it can be easily done with Assembler, just wondering if it's just as easy with C. |
15 March 2013, 10:50 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,026
|
The official includes are as free as Dice is. Why would you want to omit them?
Dice: http://aminet.net/dev/c/dice-3.16.lha Includes: http://www.haage-partner.de/download/AmigaOS/NDK39.lha Edit: haage-partner.de does not exist any more. You can get the NDK from https://os.amigaworld.de/index.php?lang=en&page=12 Direct download: https://os.amigaworld.de/download.php?id=3 Note: the 3.2 NDK does not work with Dice. Installation: Code:
lha -xa x dice-3.16.lha work:dice-rel-3.16/ lha -xa x NDK39.lha work: Code:
;BEGIN Dice C assign DCC: Work:dice-rel-3.16 assign DLIB: DCC:dlib assign DINCLUDE: DCC:include path DCC:abin add set DCCOPTS -// -proto -3.9 -D__USE_SYSBASE ;END Dice C Then either Code:
copy work:NDK_3.9/Include/include_h dinclude:amiga39 all clone Code:
makelink dinclude:amiga39 work:NDK_3.9/Include/include_h force Then clean up the Dice includes like this: Code:
cd dinclude: list ~(amiga39) all files lformat="if exists amiga39/%p%n*n delete %p%n*nendif" >ram:qqq execute ram:qqq Finally Code:
cd dlib: copy work:NDK_3.9/Include/linker_libs/amiga.lib amiga39l.lib libtos amiga39l.lib amiga39s.lib Test program: Code:
#include <proto/dos.h> int main (void) { Printf ("Hello World\n"); return (RETURN_OK); } Code:
dcc hello.c -o hello Last edited by thomas; 11 October 2023 at 09:48. |
15 March 2013, 13:18 | #3 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,835
|
|
20 March 2013, 14:05 | #4 |
Zone Friend
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
|
thomas: thanks, never knew that the SDK was freely available
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DevPac 3.xx Includes | souls | Coders. General | 40 | 12 March 2021 21:35 |
Includes | kristofferj | Coders. General | 3 | 03 May 2010 15:38 |
Devpac includes | Seoman | request.Apps | 2 | 15 April 2010 00:19 |
DevPac 3 and includes | Camionsauro | Coders. General | 10 | 20 April 2009 15:23 |
Devpac 3.x includes | lpopman | request.Apps | 2 | 14 November 2004 17:28 |
|
|