LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2006, 02:24 AM   #1
thomasw92
LQ Newbie
 
Registered: Mar 2006
Posts: 13

Rep: Reputation: 0
C preprocessor "/lib/cpp" fails sanity check


Hi, I'm running a distro called SLAX 6.0.2 Based on Slackware. I've had a problem for a few days not being able to compile things, and originally I thought it was the ./make that was wrong but then someone pointed out my error. Now after typing the error into google I can't find anything useful.

When I try to compile programmes from source i get this:

root@slax:~/Desktop/gtkspell-2.0.11# ./configure
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... /lib/cpp
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
root@slax:~/Desktop/gtkspell-2.0.11#

Isn't the C preprocessor thingy part of gcc? When I go to /lib/cpp there is a shortcut called cpp and that leads to /usr/bin/cpp which is there.

I installed gcc from a module from the SLAX site.

Thanks, Thomas
 
Old 03-26-2006, 04:02 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Can you post the last couple dozen lines of the config.log file that gets produced from this ./configure command? Chances are cpp is missing something it needs to run.
 
Old 03-26-2006, 04:07 AM   #3
thomasw92
LQ Newbie
 
Registered: Mar 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Here are the last few lines of the config.log from the programme i was trying to install (gtkspell)

ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_F77=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${prefix}/share'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/root/Desktop/gtkspell-2.0.11/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE "gtkspell"
#define PACKAGE_BUGREPORT "nathan@silverorange.com"
#define PACKAGE_NAME "gtkspell"
#define PACKAGE_STRING "gtkspell 2.0.11"
#define PACKAGE_TARNAME "gtkspell"
#define PACKAGE_VERSION "2.0.11"
#define VERSION "2.0.11"

configure: exit 1

Thanks, Thomas
 
Old 03-26-2006, 12:55 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Looks like you just have a few of the macros and definitions -- I'm looking for the actual test program it failed on, which is higher up in the file (btw I really hate how autoconf structures its log file). Can you look for that or failing that post the whole file somewhere (snipping obvious cruft. Another thing to try is copy this simple C program:

Code:
#include <stdio.h>

int main(void)
{
   puts("Hello, world.");
   return 0;
}
into a file called test1.c. Then compile it with gcc test1.c -o test1 and run it with ./test1 -- does it print "Hello, world."? Post any errors you get trying to compile it, please.
 
Old 03-27-2006, 12:51 AM   #5
thomasw92
LQ Newbie
 
Registered: Mar 2006
Posts: 13

Original Poster
Rep: Reputation: 0
configure:2030: checking for gcc
configure:2046: found /usr/bin/gcc
configure:2056: result: gcc
configure:2300: checking for C compiler version
configure:2303: gcc --version </dev/null >&5
gcc (GCC) 3.3.5
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2306: $? = 0
configure:2308: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/specs
Configured with: ../gcc-3.3.5/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 3.3.5
configure:2311: $? = 0
configure:2313: gcc -V </dev/null >&5
gcc: `-V' option must have argument
configure:2316: $? = 1
configure:2339: checking for C compiler default output file name
configure:2342: gcc conftest.c >&5
configure:2345: $? = 0
configure:2391: result: a.out
configure:2396: checking whether the C compiler works
configure:2402: ./a.out
configure:2405: $? = 0
configure:2422: result: yes
configure:2429: checking whether we are cross compiling
configure:2431: result: no
configure:2434: checking for suffix of executables
configure:2436: gcc -o conftest conftest.c >&5
configure:2439: $? = 0
configure:2464: result:
configure:2470: checking for suffix of object files
configure:2491: gcc -c conftest.c >&5
configure:2494: $? = 0
configure:2516: result: o
configure:2520: checking whether we are using the GNU C compiler
configure:2544: gcc -c conftest.c >&5
configure:2550: $? = 0
configure:2554: test -z
|| test ! -s conftest.err
configure:2557: $? = 0
configure:2560: test -s conftest.o
configure:2563: $? = 0
configure:2576: result: yes
configure:2582: checking whether gcc accepts -g
configure:2603: gcc -c -g conftest.c >&5
configure:2609: $? = 0
configure:2613: test -z
|| test ! -s conftest.err
configure:2616: $? = 0
configure:2619: test -s conftest.o
configure:2622: $? = 0
configure:2633: result: yes
configure:2650: checking for gcc option to accept ANSI C
configure:2720: gcc -c -g -O2 conftest.c >&5
configure:2726: $? = 0
configure:2730: test -z
|| test ! -s conftest.err
configure:2733: $? = 0
configure:2736: test -s conftest.o
configure:2739: $? = 0
configure:2757: result: none needed
configure:2775: gcc -c -g -O2 conftest.c >&5
conftest.c:2: error: parse error before "me"
configure:2781: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:2916: checking dependency style of gcc
configure:2999: result: gcc3
configure:3022: checking how to run the C preprocessor
configure:3057: gcc -E conftest.c
In file included from /usr/include/bits/posix1_lim.h:153,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:122,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/syslimits.h:7,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:11,
from conftest.c:12:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
configure:3063: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtkspell"
| #define PACKAGE_TARNAME "gtkspell"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "gtkspell 2.0.11"
| #define PACKAGE_BUGREPORT "nathan@silverorange.com"
| #define PACKAGE "gtkspell"
| #define VERSION "2.0.11"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3057: gcc -E conftest.c
In file included from /usr/include/bits/posix1_lim.h:153,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:122,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/syslimits.h:7,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:11,
from conftest.c:12:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
configure:3063: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtkspell"
| #define PACKAGE_TARNAME "gtkspell"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "gtkspell 2.0.11"
| #define PACKAGE_BUGREPORT "nathan@silverorange.com"
| #define PACKAGE "gtkspell"
| #define VERSION "2.0.11"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3057: gcc -E -traditional-cpp conftest.c
In file included from /usr/include/features.h:308,
from /usr/include/assert.h:36,
from conftest.c:14:
/usr/include/sys/cdefs.h:31: #error "You need a ISO C conforming compiler to use the glibc headers"
configure:3063: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtkspell"
| #define PACKAGE_TARNAME "gtkspell"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "gtkspell 2.0.11"
| #define PACKAGE_BUGREPORT "nathan@silverorange.com"
| #define PACKAGE "gtkspell"
| #define VERSION "2.0.11"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3057: gcc -E -traditional-cpp conftest.c
In file included from /usr/include/features.h:308,
from /usr/include/assert.h:36,
from conftest.c:14:
/usr/include/sys/cdefs.h:31: #error "You need a ISO C conforming compiler to use the glibc headers"
configure:3063: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtkspell"
| #define PACKAGE_TARNAME "gtkspell"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "gtkspell 2.0.11"
| #define PACKAGE_BUGREPORT "nathan@silverorange.com"
| #define PACKAGE "gtkspell"
| #define VERSION "2.0.11"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3057: /lib/cpp conftest.c
In file included from /usr/include/bits/posix1_lim.h:153,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:122,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/syslimits.h:7,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:11,
from conftest.c:12:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
configure:3063: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtkspell"
| #define PACKAGE_TARNAME "gtkspell"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "gtkspell 2.0.11"
| #define PACKAGE_BUGREPORT "nathan@silverorange.com"
| #define PACKAGE "gtkspell"
| #define VERSION "2.0.11"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3057: /lib/cpp conftest.c
In file included from /usr/include/bits/posix1_lim.h:153,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:122,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/syslimits.h:7,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:11,
from conftest.c:12:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
configure:3063: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtkspell"
| #define PACKAGE_TARNAME "gtkspell"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "gtkspell 2.0.11"
| #define PACKAGE_BUGREPORT "nathan@silverorange.com"
| #define PACKAGE "gtkspell"
| #define VERSION "2.0.11"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3140: result: /lib/cpp
configure:3164: /lib/cpp conftest.c
In file included from /usr/include/bits/posix1_lim.h:153,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:122,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/syslimits.h:7,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:11,
from conftest.c:12:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
configure:3170: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtkspell"
| #define PACKAGE_TARNAME "gtkspell"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "gtkspell 2.0.11"
| #define PACKAGE_BUGREPORT "nathan@silverorange.com"
| #define PACKAGE "gtkspell"
| #define VERSION "2.0.11"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3164: /lib/cpp conftest.c
In file included from /usr/include/bits/posix1_lim.h:153,
from /usr/include/limits.h:144,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:122,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/syslimits.h:7,
from /usr/lib/gcc-lib/i486-slackware-linux/3.3.5/include/limits.h:11,
from conftest.c:12:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
configure:3170: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtkspell"
| #define PACKAGE_TARNAME "gtkspell"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "gtkspell 2.0.11"
| #define PACKAGE_BUGREPORT "nathan@silverorange.com"
| #define PACKAGE "gtkspell"
| #define VERSION "2.0.11"
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3239: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.

Thats the main part of config.log and the Hello World Programme didn't work.

root@slax:~/Desktop# ./test1.c
./test1.c: line 3: syntax error near unexpected token `('
./test1.c: line 3: `int main(void)'

Thanks, Thomas
 
Old 03-27-2006, 01:41 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Code:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: No such file or directory
This is the source of your problems. Do you have a full set of glibc headers installed? On my Slackware 10.2 machine this file is a part of the glibc package. Maybe you need to install a separate headers package in SLAX or the file somehow became corrupt. Check the /var/log/packages directory to see if the file should have been a part of your glibc install (there is a file in /var/log/packages corresponding to each package with a list of all files belonging to that package). You should also make sure there are no other missing files.
 
Old 03-27-2006, 10:57 AM   #7
thomasw92
LQ Newbie
 
Registered: Mar 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks, I downloaded a headers module and installed it and now it works!! Thanks!!

Thomas
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error: C++ preprocessor "/lib/cpp" fails sanity check marek345 Linux - Software 4 11-06-2008 10:49 AM
c++ preprocessor "/lib/cpp" fails sanity check... siuyiu Mandriva 1 10-06-2005 06:49 PM
C preprocessor "/lib/cpp" fails sanity check silver05 Linux - Software 3 08-25-2005 06:02 AM
C++ preprocessor "/lib/cpp" fails sanity check Rundi Linux - Networking 2 07-07-2005 09:21 AM
error: C preprocessor "/lib/cpp" fails sanity check Master Fox Linux - Software 0 10-14-2004 04:39 PM


All times are GMT -5. The time now is 06:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration