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
C68 Source Compiling
-
- Font of All Knowledge
- Posts: 3976
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: C68 Source Compiling
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
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
-
- Font of All Knowledge
- Posts: 3976
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: C68 Source Compiling
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: 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.
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: 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.
Regards,
Derek
Derek
- XorA
- Site Admin
- Posts: 1368
- Joined: Thu Jun 02, 2011 11:31 am
- Location: Shotts, North Lanarkshire, Scotland, UK
Re: C68 Source Compiling
Use the filesystem type in sqlux.ini as qdos-like.
That enables filename translations on the fly!
That enables filename translations on the fly!
-
- Font of All Knowledge
- Posts: 3976
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: C68 Source Compiling
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.
Regards,
Derek
Derek