[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: simple compiling/running problem
From: |
Gaius Mulley |
Subject: |
Re: simple compiling/running problem |
Date: |
Wed, 11 Oct 2023 20:34:40 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Eric Streit <eric@yojik.eu> writes:
> 4) GCC13 gm2 (self compiled)
>
> $gm2 -g -flibs=pim,iso -o Test1 Test1.mod
>
> eric@aldebaran:~/Devs/Compilation/Test-Modula2$ ./Test1
>
> ./Test1: error while loading shared libraries: libm2pim.so.18: cannot
> open shared object file: No such file or directory
> eric@aldebaran:~/Devs/Compilation/Test-Modula2$
>
> I don't know how to do it right :( :(
>
> Best regards
>
> Eric
Hi Eric,
to run the a.out from the self compiled and self installed you need to
set the LD_LIBRARY_PATH to the shared library directory:
gaius@lancelot:~/GCC/hello$ export PATH=$HOME/opt/bin:$PATH
gaius@lancelot:~/GCC/hello$ export
LD_LIBRARY_PATH=$HOME/opt/lib64:$LD_LIBRARY_PATH
gaius@lancelot:~/GCC/hello$ gm2 -g hello.mod
gaius@lancelot:~/GCC/hello$ ./a.out
hello world
I built gcc/gm2 using
gaius@lancelot:~/GCC/hello$ gm2 -v
Configured with: ../configure --prefix=/home/gaius/opt
--libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix
--enable-clocale=gnu --enable-checking --enable-long-longx
--enable-languages=m2 --enable-multilib --enable-plugin --enable-bootstrap
Your compile command above could probably be changed to:
$ gm2 -g -o Test1 Test1.mod
or
$ gm2 -fiso -g -o Test1 Test1.mod
(the default libraries order is pim, iso and the libraries are added by
the gm2 driver),
hope this helps,
regards,
Gaius
Re: simple compiling/running problem, Eric Streit, 2023/10/12