C68 out of memory -help

Anything QL Software or Programming Related.
mhanias
Brittle Membrane
Posts: 105
Joined: Mon Jul 11, 2011 10:12 pm

C68 out of memory -help

Post 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


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

Re: C68 out of memory -help

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


Regards,

Derek
mhanias
Brittle Membrane
Posts: 105
Joined: Mon Jul 11, 2011 10:12 pm

Re: C68 out of memory -help

Post 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


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

Re: C68 out of memory -help

Post 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


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

Re: C68 out of memory -help

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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
mhanias
Brittle Membrane
Posts: 105
Joined: Mon Jul 11, 2011 10:12 pm

Re: C68 out of memory -help

Post by mhanias »

Thanks Tim but I tried with the command line.
Error again
ql3.jpg


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

Re: C68 out of memory -help

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


Regards,

Derek
mhanias
Brittle Membrane
Posts: 105
Joined: Mon Jul 11, 2011 10:12 pm

Re: C68 out of memory -help

Post by mhanias »

THANK YOU VERY MUCH DEREK

It works !

Michael


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: C68 out of memory -help

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


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Derek_Stewart
Font of All Knowledge
Posts: 3932
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: C68 out of memory -help

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


Regards,

Derek
Post Reply