Re: gpc - cannot execute binary file
On Mon, Dec 09, 2002 at 01:17:03PM +0100, Radosław Antoniuk wrote:
> warden@w2k:~/pascal$ cat pierwszy.pas
> program pierwszy;
>
> begin
> writeln('To jest test kompilatora gpc pod linuxem');
> readln;
> end.
> warden@w2k:~/pascal$ gpc -c pierwszy.pas -o pierwszy
> warden@w2k:~/pascal$ chmod 700 pierwszy
> warden@w2k:~/pascal$ ./pierwszy
> bash: ./pierwszy: cannot execute binary file
>
> miał ktoś taki problem?
[ Pascala już dawno nie używałem, ale postanowiłem spróbować co
[ namieszałeś :-)
porridge@melina:~$ sudo apt-get install gpc
Reading Package Lists... Done
Building Dependency Tree... Done
Starting
Starting 2
Done
The following extra packages will be installed:
gpc-2.95
The following NEW packages will be installed:
gpc gpc-2.95
[...]
Rozpakowanie gpc (z .../gpc_2%3a2.95.4-17_i386.deb) ...
Konfigurowanie gpc (2.95.4-17) ...
Konfigurowanie gpc-2.95 (2.95.4-15) ...
porridge@melina:~$ cat > a.pas
program pierwszy;
begin
writeln('To jest test kompilatora gpc pod linuxem');
readln;
end.
porridge@melina:~$ gpc -c a.pas -o a
porridge@melina:~$ chmod +x a
porridge@melina:~$ ./a
bash: ./a: cannot execute binary file
[hmmm...]
porridge@melina:~$ file a
a: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
porridge@melina:~$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), stripped
[HMMMMM!!!!!!!!!!! (relocatable != executable)]
porridge@melina:~$ gpc a.pas -o a
porridge@melina:~$ ./a
To jest test kompilatora gpc pod linuxem
porridge@melina:~$
[ :-) ]
No i po co było kombinować z flagami kompilatora?
Marcin
--
Marcin Owsiany <porridge@debian.org> http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216
Reply to: