XTC68 C Cross compiler
Re: XTC68 C Cross compiler
Hi everyone!
I have managed to install XTC68. It does work on a single file but I don't know how to get it to compile files some of which have
#include directives of user-created header files with relative paths.
I get these errors:
root@brizio-VirtualBox:/media/sf_Retro/CROSS-CHASE/src# make cc_tiny_no_graphics
qcc \
-D__GCC_BUFFERED__ \
...
-DALT_CLEAR_SCREEN \
cross_lib/display/display_macros.c cross_lib/display/init_images.c cross_lib/input/input_macros.c cross_lib/text/text_macros.c chase/move_player.c chase/ghost.c chase/level.c chase/character.c chase/game_text.c chase/main.c chase/strategy.c
cross_lib/display/display_macros.c:23: ../../cross_lib/cross_lib.h: No such file or directory
cross_lib/display/display_macros.c:35: images.h: No such file or directory
cross_lib/display/display_macros.c:43: graphics_settings.h: No such file or directo
...
Maybe I am not using the compiler correctly...
Are #include of user-created headers supported in XTC68?
I use includes such as:
#include "../../cross_lib/cross_lib.h"
I have managed to install XTC68. It does work on a single file but I don't know how to get it to compile files some of which have
#include directives of user-created header files with relative paths.
I get these errors:
root@brizio-VirtualBox:/media/sf_Retro/CROSS-CHASE/src# make cc_tiny_no_graphics
qcc \
-D__GCC_BUFFERED__ \
...
-DALT_CLEAR_SCREEN \
cross_lib/display/display_macros.c cross_lib/display/init_images.c cross_lib/input/input_macros.c cross_lib/text/text_macros.c chase/move_player.c chase/ghost.c chase/level.c chase/character.c chase/game_text.c chase/main.c chase/strategy.c
cross_lib/display/display_macros.c:23: ../../cross_lib/cross_lib.h: No such file or directory
cross_lib/display/display_macros.c:35: images.h: No such file or directory
cross_lib/display/display_macros.c:43: graphics_settings.h: No such file or directo
...
Maybe I am not using the compiler correctly...
Are #include of user-created headers supported in XTC68?
I use includes such as:
#include "../../cross_lib/cross_lib.h"
- NormanDunbar
- Forum Moderator
- Posts: 2287
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Leeds, West Yorkshire, UK
- Contact:
Re: XTC68 C Cross compiler
Don't use paths, just include the header files. Then, on the compiler execution, supply as many "-I path_to_headers" as necessary. These options tell the compiler where to look for header files.
That's an upper case "i" not a lower case "L" by the way.
So for
Use
And
(edited to remove crud!)
HTH
Cheers,
Norm.
That's an upper case "i" not a lower case "L" by the way.
So for
Code: Select all
#include "../../cross_lib/cross_lib.h"
Code: Select all
#include "cross_lib.h"
Code: Select all
qcc -o binaryfile.exe -I "../../cross_lib" sourcefile.c
HTH
Cheers,
Norm.
Last edited by NormanDunbar on Sat Oct 26, 2019 10:20 pm, edited 1 time in total.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: XTC68 C Cross compiler
Thanks!
My code goes through a tool chain made of more or less C89 C cross-compilers including also CC65, Z88DK, CMOC, ACK, Z8K-GCC...
#include "../foo.h"
seems to be C89-compliant
I need my code to compile on all of these compilers. The solution is to have my code to be C89-compliant.
What you propose will break the compilation on all other compilers... unless I pollute tens of files with #ifdef XTC68 directives to do a different include only for XTC69.
A clear solution would be to understand how to avoid includes with relative paths in a C89-compliant way that can be understood by all the compilers of my "universal" tool chain...
I need to figure it out...
Fabrizio
My code goes through a tool chain made of more or less C89 C cross-compilers including also CC65, Z88DK, CMOC, ACK, Z8K-GCC...
#include "../foo.h"
seems to be C89-compliant
I need my code to compile on all of these compilers. The solution is to have my code to be C89-compliant.
What you propose will break the compilation on all other compilers... unless I pollute tens of files with #ifdef XTC68 directives to do a different include only for XTC69.
A clear solution would be to understand how to avoid includes with relative paths in a C89-compliant way that can be understood by all the compilers of my "universal" tool chain...
I need to figure it out...
Fabrizio
Re: XTC68 C Cross compiler
@NormanDunbar, I think your suggestion is really good.
I just need to check whether it can be used with all compilers.
I just need to check whether it can be used with all compilers.
- NormanDunbar
- Forum Moderator
- Posts: 2287
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Leeds, West Yorkshire, UK
- Contact:
Re: XTC68 C Cross compiler
Hi Fabrizio,
All the C compilers that I've ever used have the "-I" command line options, including C68 for the QL. So you shouldn't need to worry about polluting your files with #ifdefs.
Cheers,
Norm.
All the C compilers that I've ever used have the "-I" command line options, including C68 for the QL. So you shouldn't need to worry about polluting your files with #ifdefs.
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
Re: XTC68 C Cross compiler
A quick question about the libraries, specifically the QDOS system calls, specifically mt_susjb
The call is defined to have three arguments, the job id, timeout period and a char *. What's the char * for? The system call doesn't use one or return a string.
(The only QL C compiler docs I have are for the Metacomco C Compiler and that doesn't have that sort of syscall interface.)
The call is defined to have three arguments, the job id, timeout period and a char *. What's the char * for? The system call doesn't use one or return a string.
(The only QL C compiler docs I have are for the Metacomco C Compiler and that doesn't have that sort of syscall interface.)
Re: XTC68 C Cross compiler
At least the QL Technical Guide mentions the flag byte - It's the MT.SUSJB trap's A1 parameter. The byte this address points to is set to "0" by QDOS when the suspension is either lifted by the OS (when the timeout expires) or an MT.RELJB call. You can use this if another job wants to be notified when the suspended job is released.C68 Manual wrote: char *zero is an address of a byte to set to zero on release of the job if required. If this is not required pass NULL in place of 'char *zero'.
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
Re: XTC68 C Cross compiler
Is there any documentation on the XTC68LIB libraries? I can't find any (or even the source).
I see from the headers that there's a do_sound function but without a description of what the parameters actually are it's pretty useless.
I'm sure there's a lot of other very useful stuff locked up in there which is also unusable without documentation.
I see from the headers that there's a do_sound function but without a description of what the parameters actually are it's pretty useless.
I'm sure there's a lot of other very useful stuff locked up in there which is also unusable without documentation.
Re: XTC68 C Cross compiler
Stephen,
both documentation and source code for the XTC68 libs are part of the C68 distribution (the libraries are the same and built from the very same sources). Check Dilwyn's site.
(This is more or less a compilation of the _doc files that come with C68, a bit cross-referenced, indexed and PDFed.)
both documentation and source code for the XTC68 libs are part of the C68 distribution (the libraries are the same and built from the very same sources). Check Dilwyn's site.
Or check here:2.8.9 void do_sound( int duration, int pitch, int pitch2, int wrap, int g_x, int g_y,int fuzz, int random)
QDOS call to make a sound. Parameters defined as for SuperBasic beep call.
(This is more or less a compilation of the _doc files that come with C68, a bit cross-referenced, indexed and PDFed.)
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO