Re: Problem mit Variablendekleration

Ralf Corsepius <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
On Mon, 2005-06-20 at 23:16 +0200, Philipp Otte wrote:
> Hi,
> ich habe folgendes Problem. Ich schreibe ein Programm, dass den
> ELF-Header einer ELF-Datei ausliest.
> Das Programm liegt aufs Problem gestutzt als Anhang dabei.
> Dabei gibt mir der gcc folgende Fehlermeldung aus:
> 
> philipp@philipp:~$ gcc -o elftest elftest.c
> elftest.c: In Funktion »main«:
> elftest.c:8: error: storage size of `header' isn't known
> elftest.c:13: error: invalid application of `sizeof' to an incomplete
> type
> 
> Wieso weiß der gcc nicht, wie groß Elf32_Ehdr ist?

Weil Du in Deinem Code "struct Elf32_Ehdr" erwartest,
elf.h aber "Elf32_Ehdr" (Ein typedef) bereitstellt.

Ersetze in Deinem Code alle "struct Elf32_Ehdr" durch "Elf32_Ehdr" und
es sollte funktionieren.

Ralf



-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfügbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
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.