You are not logged in.

#1 2009-09-21 22:13:13

slyson
Member
Registered: 2008-03-23
Posts: 24

[Solved] Cannot build any C programs

I'm getting 'expected declaration' and 'undeclared (first use in this function' errors spewed across my screen when compiling ANY C programs or scripts e.g., cwrapper, mingetty. I'd be more specific but the errors vary across compilations.

Example compiling mingetty:

In file included from mingetty.c:28:
/usr/include/stdio.h:34:21: error: stddef.h: No such file or directory
In file included from /usr/include/stdio.h:75,
                 from mingetty.c:28:
/usr/include/libio.h:53:21: error: stdarg.h: No such file or directory
In file included from /usr/include/stdio.h:75,
                 from mingetty.c:28:

I already have the base-devel group and gcc package installed. What's more, all C scripts compiled fine up until a few hours ago.

I'm in the process of a fresh Arch install so can't remember the exact steps leading up to the problem, but I do remember running a 'pacman -Syu'.

Any idea what the problem is?

Last edited by slyson (2009-09-22 13:15:57)

Offline

#2 2009-09-21 23:19:35

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: [Solved] Cannot build any C programs

slyson wrote:
In file included from finit-arc.c:1:
/usr/include/stdio.h:34:21: error: stddef.h: No such file or directory
In file included from /usr/include/stdio.h:75,
                 from finit-arc.c:1:
/usr/include/libio.h:53:21: error: stdarg.h: No such file or directory
In file included from /usr/include/stdio.h:75,
                 from finit-arc.c:1:

You're probably missing stddef.h and stdarg.h (in /usr/lib/gcc/something/4.4.1/include/). All the other errors are a result of this.

Try reinstalling gcc, since it owns them. But before doing that, please confirm that they do not, in fact, exist.

Last edited by Peasantoid (2009-09-21 23:23:53)

Offline

#3 2009-09-21 23:21:58

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [Solved] Cannot build any C programs

Do you have klibc installed?

Offline

#4 2009-09-21 23:36:24

slyson
Member
Registered: 2008-03-23
Posts: 24

Re: [Solved] Cannot build any C programs

I've tried re-installing gcc and klibc and I already have the files that are claimed missing:

pacman -Ql gcc G stddef.h\|stdarg.h 

gcc /usr/lib/gcc/i686-pc-linux-gnu/4.4.1/include/cross-stdarg.h
gcc /usr/lib/gcc/i686-pc-linux-gnu/4.4.1/include/stdarg.h
gcc /usr/lib/gcc/i686-pc-linux-gnu/4.4.1/include/stddef.h

.... and actually I've edited the original post to avoid confusion because the error I pasted originally was another users problem from another thread. Now I've changed it to the errors from compiling mingetty - although the errors are still the same.

Last edited by slyson (2009-09-22 14:53:36)

Offline

#5 2009-09-21 23:45:36

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: [Solved] Cannot build any C programs

Yes, but does -Ql only list existing files? Or does it just tell you what's supposed to be in the package? Try -Qk instead. (pacman -Qk gcc)

Offline

#6 2009-09-21 23:50:50

slyson
Member
Registered: 2008-03-23
Posts: 24

Re: [Solved] Cannot build any C programs

pacman -Qk gcc                     
gcc: 1504 total, 0 missing file(s)

...and said files do exist on the disk.

Last edited by slyson (2009-09-21 23:52:14)

Offline

#7 2009-09-22 13:15:07

slyson
Member
Registered: 2008-03-23
Posts: 24

Re: [Solved] Cannot build any C programs

cwrapper was causing the problem. I commented out these lines (that the cwrapper post install script recommends) in my .zshrc:

export PATH='/usr/lib/cw:$PATH"
export NOCOLOR_PIPE=1

I suspect it is something to do with the path line so I'll get back with a solution soon.

Last edited by slyson (2009-09-22 13:19:49)

Offline

Board footer

Powered by FluxBB