Page 1 of 3

C68 out of memory -help

Posted: Mon Aug 17, 2020 7:14 pm
by mhanias
I try to run the simplest program "Hello world" , in C68 ansi C, I got the message

ld:Error 0
Out of memory
Use 620004ption (- with cc)
To increase memory allocation.

My Ql has trump card 896K and 720K floppy.

I cannot find this option in QC8 manual.
Any help?

Thanks
Michael

Re: C68 out of memory -help

Posted: Mon Aug 17, 2020 8:22 pm
by Derek_Stewart
Hi Michael,

Can you post the C68 source file and the command line you used to compile the C68 file.

The simple hello world programme should be compiled by entering the command:

EX cc;"-v hello_world_c -o hello_world_exe -lm"

Re: C68 out of memory -help

Posted: Mon Aug 17, 2020 9:39 pm
by mhanias
Here is the code

#include <stdio_h>
#include <math_h>
#include <stdlib_h>
#include <time_h>
main(){
printf("Hello world\n");
return 0;
}

In QPC2 it works perfect but in real Ql and Qemulator does not.
C68menu
C68menu
error
error

Re: C68 out of memory -help

Posted: Mon Aug 17, 2020 9:54 pm
by swensont
I've not used C68_Menu, so I don't know if it has any issues. To eliminate it as a source, please use C68 from the command line and see if you get the same compile error.

BTW, you don't need math_h or time_h for this simple program.

Tim

Re: C68 out of memory -help

Posted: Mon Aug 17, 2020 10:01 pm
by tofro
I think I had the same problem once, but can't for the life of me remember what it was, unfortunately.

It had absolutely nothing to do with the C compiler, but rather the environment - probably no RAM disk available or something.

Re: C68 out of memory -help

Posted: Mon Aug 17, 2020 10:07 pm
by mhanias
Thanks Tim but I tried with the command line.
Error again
ql3.jpg

Re: C68 out of memory -help

Posted: Tue Aug 18, 2020 3:11 pm
by Derek_Stewart
Hi,

I set my Tetroid Trump Card up and was able to repeat the error message.

The clue to the solution of the problem is at the end of the linking operation.

The Linker is running out of programme space to complete the operation. I you read the LD part of the C68 manual, at the end of the section, there are a description of memory buffer options.

The -bufp is the required option to use, I tried 32K which maybe too much.

The ammended command line is :

EX cc;"-v hello_world_c -ohello_world_exe -bufp32K -lm"

this now compiles on the Trump Card correctly, to exrcute the the co piled programme:

EX hello_world_exe

The LD options can be set in the command line or the environmental variables, see documentation for this.

Re: C68 out of memory -help

Posted: Tue Aug 18, 2020 6:53 pm
by mhanias
THANK YOU VERY MUCH DEREK

It works !

Michael

Re: C68 out of memory -help

Posted: Tue Aug 18, 2020 9:52 pm
by NormanDunbar
Well, I'm a bit puzzled that a simple program like the example here should need extra memory for the linker. I've never had to add memory for the linker, ever, and I've compiled some hefty programs on a BBQL - the Quanta Library Guide is one of mine, for example.

I wonder what's going on?

Cheers,
Norm.

Re: C68 out of memory -help

Posted: Tue Aug 18, 2020 11:39 pm
by Derek_Stewart
Hi,

I compiled the "Hello_World" programme on a Q68 running SMSQ/E v3.36, which did not need the increase in the linker programme buffer.

I tried increading the linker buffer, with the -bufl option. Which did not work, only uding the -bufp opyion to 32K enabled the programme to compile on the QL under JS Rom.

I thought, maybe the problem is JS Rom problem, so installed Minerva v1.98, but compiling the C68 programme would not compile till the bufp option wss increased. Strange it is not required on SMSQ/E.