Re: Scriptbasic - Compiling the generated C code



Johannes Bauer <dfnsonfsduifb@xxxxxx> wrote:
Why are you doing this and not specifying

Because I am guessing more than anything. The notes for tcc (Tiny C
compiler), which I have used in the past, tell me that it has a GCC
compatible command line, and yet contradictory notes tell me that I use
a command line similar to Microsoft C. I don't know whether instruction
set A or instruction set B is correct, or whether or not both are
supported. Prior learning (on MSDOS) tells me that to compile a file and
link to a library, I list the library as a command line dependency.

cc -o hello hello.c /usr/lib/scriba/lscriba.a

The tcc documentation, also suggests this. However it also states gcc
compatibilty, so I assume gcc takes the same syntax also.

gcc -L/usr/lib/scriba -lscriba -o hello hello.c

I had seen some instructions with this command line. It does not work,
giving an error:

gcc -L/usr/lib/scriba -lscriba -o hello hello.c
hello.c:27:25: warning: no newline at end of file
/tmp/cct2n4gM.o: In function `main':
hello.c:(.text+0x25): undefined reference to `stndlone'
collect2: ld returned 1 exit status

I was not sure whether the -lscriba was correct. I thought maybe this
was -l with a library name attached. My library name begins with l so I
thought maybe -llscriba . I have no explanation for the missing l
following the minus.

Anyhow, I still get an error:

gcc -L/usr/lib/scriba -llscriba -o hello hello.c
hello.c:27:25: warning: no newline at end of file
/usr/bin/ld: cannot find -llscriba
collect2: ld returned 1 exit status

Ok, I'll now try libscriba.a which also exists. Omitting the letter l:

gcc -L/usr/lib/scriba -libscriba -o hello hello.c
hello.c:27:25: warning: no newline at end of file
/usr/bin/ld: cannot find -libscriba
collect2: ld returned 1 exit status

with the letter l:

gcc -L/usr/lib/scriba -llibscriba -o hello hello.c
hello.c:27:25: warning: no newline at end of file
/usr/bin/ld: cannot find -llibscriba
collect2: ld returned 1 exit status

Hmmm.

ls -l /usr/lib/scriba

-rw-r--r-- 1 root root 664704 2008-01-28 02:31 libscriba.a
-rw-r--r-- 1 root root 662086 2008-01-28 02:31 lscriba.a

It is interesting that -lscriba does not report it cannot find -lscriba
but -libscriba does report it cannot find -libscriba

I am confused.

It would also be useful to know the difference between libscriba and
lscriba. So far nobody seems to know.

Mark.

--
Mark Hobley,
393 Quinton Road West,
Quinton, BIRMINGHAM.
B32 1QE.
.



Relevant Pages