[solved]Problems with AHCC

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

RA_pdx
Captain Atari
Captain Atari
Posts: 215
Joined: Sun Feb 02, 2003 12:01 pm
Location: Nuernberg/GERMANY

[solved]Problems with AHCC

Postby RA_pdx » Wed Jan 16, 2013 9:22 pm

I have got some problems with AHCC and my source code. I hope it´s not just my rusty C knowledge again. :wink: All code is tested with other ANSI C compilers and works fine there.

1st problem - testing for valid pointer:

Code: Select all

size_t* pCookiesTemp = (size_t*)0x5A0;
size_t* pCookies = (size_t*)*pCookiesTemp;
if (pCookies){
...
}

Here the compiler doesn´t like line three.

2nd Problem - include files and function prototyping:
init.c

Code: Select all

#include "init.h"
bool InitAtari(long lScreenSize){
SendIKBD();
...
}
void SendIKBD(){
...
}

init.h

Code: Select all

#ifndef __INIT_H
#define __INIT_H
typedef _Bool bool;
bool InitAtari(long lScreenSize);
void SendIKBD();
#endif

I have included init.h also in main.c. While compiling i get the errors "global decleration missing ';' at typedef " and "bad second declaration of : 'InitAtari'".

Can anyone help me?
Last edited by RA_pdx on Mon Jan 21, 2013 8:11 am, edited 1 time in total.
>> > raZen/Paradox < <<

Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile

RA_pdx
Captain Atari
Captain Atari
Posts: 215
Joined: Sun Feb 02, 2003 12:01 pm
Location: Nuernberg/GERMANY

Re: Problems with AHCC

Postby RA_pdx » Mon Jan 21, 2013 8:11 am

I got it working! :)

1st problem: Was my own fault. In a function you have to declare all variables at the beginning (ANSI C). :oops:

2nd problem: I have tried to change the order of include files and one new order works. Even there is no reason for me why one is working and the other not.

Now hopefully i can start coding...
>> > raZen/Paradox < <<

Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1956
Joined: Sun Jul 31, 2011 1:11 pm

Re: Problems with AHCC

Postby Eero Tamminen » Mon Jan 21, 2013 10:53 am

RA_pdx wrote:2nd problem: I have tried to change the order of include files and one new order works. Even there is no reason for me why one is working and the other not.


Probably you're messing with some variable or type already used by AHCC headers. For example the bool thing looks suspicious, why you don't use the standard: #include <stdbool.h> ?

RA_pdx
Captain Atari
Captain Atari
Posts: 215
Joined: Sun Feb 02, 2003 12:01 pm
Location: Nuernberg/GERMANY

Re: Problems with AHCC

Postby RA_pdx » Mon Jan 21, 2013 1:31 pm

Eero Tamminen wrote:For example the bool thing looks suspicious, why you don't use the standard: #include <stdbool.h> ?


Thanks for this hint i will try it this evening.
>> > raZen/Paradox < <<

Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 1 guest

cron