English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 15 March 2013, 08:51   #1
redblade
Zone Friend

redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 37
Posts: 1,792
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.
redblade is offline  
Old 15 March 2013, 10:50   #2
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,357
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

Installation:

Code:
lha -xa x dice-3.16.lha work:dice-rel-3.16/
lha -xa x NDK39.lha work:
put this into s:user-startup:

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
and reboot.

Then either

Code:
copy work:NDK_3.9/Include/include_h dinclude:amiga39 all clone
or

Code:
makelink dinclude:amiga39 work:NDK_3.9/Include/include_h force
if your file system supports this.

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);
}
compile with

Code:
dcc hello.c -o hello
thomas is offline  
Old 15 March 2013, 13:18   #3
kamelito
Zone Friend

kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,409
You can even run DICE under OSX
http://lallafa.de/blog/2011/06/dice-...isited-on-mac/

Kamelito
kamelito is offline  
Old 20 March 2013, 14:05   #4
redblade
Zone Friend

redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 37
Posts: 1,792
thomas: thanks, never knew that the SDK was freely available
redblade 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
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

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 20:23.


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