Problem when compiling a simple C-- program

Peter BARABAS <[email protected]>
Newsgroups gmane.comp.lang.c--
Message-ID <[email protected]>
Good day,

I have a file named sp2.cmm:

target
    memsize 8
    byteorder little
    pointersize 32
    wordsize 32;

export sp2;

sp2(bits32 n) {
  jump sp2_help(n, 1, 1);
}

sp2_help(bits32 n, bits32 s, bits32 p) {
  if n == 1 {
      return(s, p);
  } else {
      jump sp2_help(n-1, s+n, p*n);
  }
}

This is how I try to compile it:

qc-- sp2.cmm

and this is what I get:

/usr/lib/gcc-lib/i486-linux/3.3.5/../../../crt1.o(.text+0x18): In
function `_start':
../sysdeps/i386/elf/start.S:98: undefined reference to `main'
sp2.o(.data+0x0): In function `Cmm.ref_to_global_area':
: undefined reference to `Cmm.globalsig.aQOYZWMPACZAJaMABGMOZeCCPY'
collect2: ld returned 1 exit status

Though sp2.o and sp2.s gets created. What can cause that error
message? These are my system's parameters:

QC version: latest, qc--20050330
Debian sid
kernel: 2.4.27
Ocaml: 3.08.3
LUA: 4.0

ldd gc-- gives:
        libm.so.6 => /lib/libm.so.6 (0x40020000)
        libdl.so.2 => /lib/libdl.so.2 (0x40042000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x40045000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x40085000)
        libc.so.6 => /lib/libc.so.6 (0x400d6000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Thank you in advance.

-- 
'(Yours parenthetically),
peter barabas.

((call/cc call/cc) (call/cc call/cc))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.