C68 Source Compiling

Anything QL Software or Programming Related.
Post Reply
Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

C68 Source Compiling

Post 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


Regards,

Derek
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: C68 Source Compiling

Post 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


Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: C68 Source Compiling

Post 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
C68.png (8.73 KiB) Viewed 542 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.


Regards,

Derek
User avatar
XorA
Site Admin
Posts: 1368
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: C68 Source Compiling

Post by XorA »

Use the filesystem type in sqlux.ini as qdos-like.

That enables filename translations on the fly!


Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: C68 Source Compiling

Post 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.


Regards,

Derek
Post Reply