[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Can't get my program linked '-static'
From: |
Rudolf Schubert |
Subject: |
Can't get my program linked '-static' |
Date: |
Sat, 20 May 2023 11:00:40 +0200 (CEST) |
Hi Gaius,
you remember the tarball I sent to you back in April? Things are running
fine now. Even the three 'bug versions' do not have problems any more.
That's really great!
What I now try to do: get a static binary. But for some reason it does not
work. For dynamic linking I use this command which is working perfectly:
> gm2 -fiso -fsoft-check-all squash1.mod Ctv2.o unix.o -o squash1 -lc -lcrypt
> -lm
Now for static linking I simply append a '-static' at the end:
> gm2 -fiso -fsoft-check-all squash1.mod Ctv2.o unix.o -o squash1 -lc -lcrypt
> -lm -static
But this gives me several messages like:
...in function `m2iso_RealMath_exp':
...undefined reference to `exp'
Interestingly 'sqrt' ist NOT mentioned, which is the only function from
RealMath which I use in my program.
If I just make a very tiny test program like this I can do
-static linking without any problem:
MODULE port_test11_gm2;
FROM IOChan IMPORT
ChanId;
FROM RealIO IMPORT
WriteReal;
FROM RealMath IMPORT
sqrt;
FROM StdChans IMPORT
StdOutChan;
FROM TextIO IMPORT
WriteLn;
PROCEDURE RealMathTest();
VAR
cid_out: ChanId;
r1, r2: REAL;
BEGIN (* PROCEDURE RealMathTest *)
cid_out := StdOutChan();
r1 := 16.0;
r2 := sqrt(r1);
WriteReal(cid_out, r2, 1);
WriteLn(cid_out);
END RealMathTest;
BEGIN (* MODULE port_test11_gm2 *)
RealMathTest();
END port_test11_gm2.
Would I have to change my command line in order to do static linking
or what might be the reason that it does not work?
BR
Rudolf
--
Rudolf Schubert \
Kirchstr. 18a \ mailto:rudolf@muc.de
82054 Sauerlach > http://www.dose.muc.de
Deutschland /
Tel. 08104/908311 /
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Can't get my program linked '-static',
Rudolf Schubert <=