QDOS gcc made easy (docker stylee)

Anything QL Software or Programming Related.
User avatar
XorA
Gold Card
Posts: 492
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

QDOS gcc made easy (docker stylee)

Postby XorA » Fri Sep 15, 2017 6:24 pm

Create a file hello.c

Code: Select all

#include <stdio.h>

int main(int argc, char **argv)
{
    printf("Hello\n");
}


run docker like so

Code: Select all

docker pull xora/qdos-gcc
docker  run -v $PWD:/build -w /build -u $USER xora/qdos-gcc qdos-gcc -o hello hello.c


and you should have hello as a QDOS executable.

This is my first play with docker so please let me know any problems.


User avatar
XorA
Gold Card
Posts: 492
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: QDOS gcc made easy (docker stylee)

Postby XorA » Fri Sep 15, 2017 7:49 pm

Fixed image now so -w argument is no longer needed.


Fabrizio
ROM Dongle
Posts: 5
Joined: Thu Apr 19, 2018 11:09 am

Re: QDOS gcc made easy (docker stylee)

Postby Fabrizio » Sun Jun 10, 2018 11:09 pm

Hi!

I would like to compile my universal game CROSS CHASE for the QL.
Ideally I would like to use it within Cygwin. To get me started as fast as possible I have tried the docker version but I cannot get to compile the hello world code.

I don't have much experience with docker. I have managed to pull the docker image.

I get the following error:
$ docker run -v $PWD:/build -w /build -u $USER xora/qdos-gcc qdos-gcc --version
C:\Program Files\Docker Toolbox\docker.exe: invalid reference format: repository name must be lowercase.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

On the other hand I can run
$ docker run xora/qdos-gcc qdos-gcc --version
2.95.3

But if I try to compile anything the file is not found.
$ docker run xora/qdos-gcc qdos-gcc /c/Retro/test/hello.c
qdos-gcc: /c/Retro/test/hello.c: No such file or directory
qdos-gcc: No input files

but the file is there

$ ll /c/Retro/test/hello.c
-rw-r--r-- 1 Brizio 197121 81 Jun 10 16:33 /c/Retro/test/hello.c

What am I doing wrong?


User avatar
XorA
Gold Card
Posts: 492
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: QDOS gcc made easy (docker stylee)

Postby XorA » Mon Jun 11, 2018 8:38 pm

You need to remap the directory with the source code into the container.


Fabrizio
ROM Dongle
Posts: 5
Joined: Thu Apr 19, 2018 11:09 am

Re: QDOS gcc made easy (docker stylee)

Postby Fabrizio » Tue Jun 12, 2018 9:28 am

How?
Could you please give me an example on how to build a hello world program?

I have tried the suggested command but I get:
C:\Program Files\Docker Toolbox\docker.exe: invalid reference format: repository name must be lowercase.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

Fabrizio


User avatar
XorA
Gold Card
Posts: 492
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: QDOS gcc made easy (docker stylee)

Postby XorA » Tue Jun 12, 2018 2:53 pm

Fabrizio wrote:How?
Could you please give me an example on how to build a hello world program?

I have tried the suggested command but I get:
C:\Program Files\Docker Toolbox\docker.exe: invalid reference format: repository name must be lowercase.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

Fabrizio


-v $PWD:/build is what maps the directory to the /build dir where compiler is run inside the container.

so replace $PWD with your top level directory.

But I am unfamiliar with windows docker as to why you get that error message, my guess would be that either $PWD has a space in it or $USER does not exist in cygwin.



Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 3 guests