C68 Compiling

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

C68 Compiling

Post by Derek_Stewart »

Hi,

I seem to of forgotten how to compile a C programme with a .c extension.

I tried to compile the "alter.c" module from SQLite with, which gave this error:
C68 Compile in Cview
C68 Compile in Cview
C68_compile.png (4.95 KiB) Viewed 1347 times
I like to use CVIEW to compile C modules, which up to now has had a "_c " extension and work OK.

My simple solution was to rename the .c to _c but then the compiler can not find the .h file

I seem to have a brain freeze on this, I have read the C68 manual many times bit can not see the solution.


Regards,

Derek
User avatar
Ruptor
Gold Card
Posts: 420
Joined: Fri Dec 20, 2019 2:23 pm
Location: London

Re: C68 Compiling

Post by Ruptor »

Derek_Stewart wrote:My simple solution was to rename the .c to _c but then the compiler can not find the .h file
This is probably a stupid suggestion but do all the files have to be _ so .h >>_h?


User avatar
tofro
Font of All Knowledge
Posts: 3125
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: C68 Compiling

Post by tofro »

Solution for industrious guys:

Rename all files from *.c and *.h to *_c and *_h

Lazy guys pack everything on a dos drive on QPC and let its file name translation do the job.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
XorA
Site Admin
Posts: 1643
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: C68 Compiling

Post by XorA »

tofro wrote:Solution for industrious guys:

Rename all files from *.c and *.h to *_c and *_h

Lazy guys pack everything on a dos drive on QPC and let its file name translation do the job.
And really lazy guys use xtc68 to cross compile :-D

But yes, c68 was the reason I added automatic . -> _ translation to sQLux!


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

Re: C68 Compiling

Post by Derek_Stewart »

Hi

Thanks for the advice, my solution wad to rename all the files with .c or .c to _c or _h

It is strange that C68 header files can be defined as _h or .h in the C programme file. But a header file in the C source code file has to be _h

Maybe using XTC68 is a better option.


Regards,

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

Re: C68 Compiling

Post by Derek_Stewart »

Hi,

I am sure there is a something that can be supplied to the C68 CC programme to switch off the automatic extension translation.

But in the interim, my solution was to unzip the C source code with infoUNZIP and junk the stored directories, with the -j option, so that only the files are stored with the .c or .h extension changed to a _c or _h extension and C68 converts to the header file calls to QDOS as necessary.

I could use all the automatic file translation that all emulators use now, but the unzip process works as well, even on BBQLs ...

Maybe this is what I used to do.

So, back to reading the manual.


Regards,

Derek
Post Reply