Page 1 of 1
C68 Source Compiling
Posted: Tue Jan 16, 2024 9:19 pm
by Derek_Stewart
A quick question wrt C68 in a QL environment.
When I try to compile C source code with a .c or .h extension, the C68 CC can not find the files till the extensions are changed to _c or_h
Is there a setting or ENV variable to be set?
No probs with XTC68, or QDOS-GCC
Re: C68 Source Compiling
Posted: Wed Jan 17, 2024 5:56 am
by swensont
I know that standard include files can be referenced with .h, and the preprocessor converts the '.' to a '_'.
Here is what the C68 manual says:
Filenames given to the #include directive may contain a '.' as the extension separator. During processing, any '.' will be translated to an underscore, and the resultant filename used in subsequent actions. Similarly, any '/' (UNIX) or '\' (MSDOS) directory separators will be translated to underscores.
I think all files that are part of the command line when invoking 'cc' need to have the normal QL extension separator of '_'.
Here is what the manual says about library names:
By convention library names are given in a specially compact format. The names for libraries are made up by adding a prefix of 'lib' and an extension of '_a' to the name specified on the command line. For example the main C library is called libc_a and the maths library is called libm_a.
I'm not seeing anything on the C68 docs about changing the separator.
Tim
Re: C68 Source Compiling
Posted: Wed Jan 17, 2024 9:10 am
by Derek_Stewart
HI Tim,
The problem raised itself when I was trying to compile Elivis v1.16 using make.
I store the Elivis file on a Linux share access from SMSQmulator, by Native File Access: NFA4_
Then running C68 MAKE on the makefile gives an error: Don't know how to make vi_h, when the file is vi.h:

- C68.png (8.73 KiB) Viewed 1126 times
Changing the file to vi_h all is fine and make compiles the source code.
Using XTC68, which is the same compiler, compiles the source okay. This only appears in QL Make.
Re: C68 Source Compiling
Posted: Wed Jan 17, 2024 4:53 pm
by XorA
Use the filesystem type in sqlux.ini as qdos-like.
That enables filename translations on the fly!
Re: C68 Source Compiling
Posted: Thu Jan 18, 2024 2:37 pm
by Derek_Stewart
XorA wrote: Wed Jan 17, 2024 4:53 pm
Use the filesystem type in sqlux.ini as qdos-like.
That enables filename translations on the fly!
Hi,
Thank you for the information, mapping a QDOS device to a native file directory, with qdos-like, does convert the "." extension separator to "_"
To cmpile this in a QWA container, or QDOS environment, I compressed the C source files and extracted them to a QDOS environment, with infoUnzip v5.40, this also converted the separators and the C files could be compiled.
I am not sure if cross-compiling is better than compiling in a QL filesystem.