LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   cpp sanity check fails. (http://www.linuxquestions.org/questions/linux-software-2/cpp-sanity-check-fails-4175437051/)

cov 11-14-2012 02:16 AM

cpp sanity check fails.
 
I've just used git to download the source for Libredwg.

I've used the autogen script to generate a 'configure' script, which, when I run it, gives the following error:

Code:

configure: error: C preprocessor "/lib/cpp" fails sanity check
The config.log file has a number of very similar errors.

Code:

|                      Syntax error
configure:7083: gcc -E  conftest.c
In file included from conftest.c:10:0:
/usr/include/limits.h:125:26: error: no include path in which to search for limits.h
configure:7083: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "LibreDWG"
| #define PACKAGE_TARNAME "libredwg"
| #define PACKAGE_VERSION "0.4-dev"
| #define PACKAGE_STRING "LibreDWG 0.4-dev"
| #define PACKAGE_BUGREPORT "libredwg@gnu.org"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */

As far as I can tell I have all the correct glibc libraries and dev libraries installed (on a Mint Ubuntu derivative).

I'm also reasonably sure that I compiled this code successfully previously, in which case the git update may have introduced a bug. Is this likely? How do I fix it?

knudfl 11-14-2012 06:19 AM

Quote:

/usr/include/limits.h:125:26: error:
no include path in which to search for limits.h
"/usr/include/limits.h" is provided by 'libc6-dev'.


Quote:

configure: error: C preprocessor "/lib/cpp" fails sanity check
The g++ compiler must be installed to have a fully working gcc (cpp) :
sudo apt-get install g++
Also required for libredwg : swig texinfo

Example : No issues with 'libredwg', Ubuntu 12.04 - 32bits. ( gcc-4.6.3 ).

.

cov 11-14-2012 08:02 AM

Hi Knudfi,

Many thanks for your reply.

Code:

sudo apt-get install g++
[sudo] password for dave:
Reading package lists... Done
Building dependency tree     
Reading state information... Done
g++ is already the newest version.
g++ set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.


cov 11-14-2012 08:25 AM

Swig & texinfo are installed:

Code:

sudo apt-get install swig texinfo
Reading package lists... Done
Building dependency tree     
Reading state information... Done
swig is already the newest version.
texinfo is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

limits.h is present, too:

Code:

ls -l /usr/include/limits.h
-rw-r--r-- 1 root root 4596 2012-09-21 09:01 /usr/include/limits.h


knudfl 11-14-2012 10:12 AM

'libredwg' test 2 : Ubuntu 12.10, 32bits , gcc-4.7.2 : No errors.
Additional requirement was : python-all-dev

Which OS is it about ? I'd guess it has some name.
Please show the output from the commands ..
1) gcc --version
2) uname -m
3) cat /etc/issue

.

cov 11-14-2012 11:35 AM

Thanks for going to this trouble.

python-all-dev is installed.

As I mentioned, the OS a Ubuntu derivative called Mint.

Code:

gcc --versiongcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Code:

uname -m
x86_64

Code:

cat /etc/issue
Linux Mint 12 Lisa \n \l


knudfl 11-14-2012 04:29 PM

OK, the 64bits Linux Mint 12 Lisa.

I can have a look at Mint 12 - 64bits later.
( No errors on a 64bits Ubuntu 12.04 )

Hints : May be reinstall the gcc packages ( + libtool ):
sudo apt-get install --reinstall \
libtool cpp-4.6 libgcc1 gcc-4.6 g++-4.6

Quote:

/usr/include/limits.h:125:26: error:
no include path in which to search for limits.h
Line 125, /usr/include/limits.h :
Seems to be about the "gcc limits.h"
( ? /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h ?
? /usr/include/c++/4.6/tr1/limits.h ? ).

.

cov 11-15-2012 06:07 AM

Code:

sudo apt-get install --reinstall libtool cpp-4.6 libgcc1 gcc-4.6 g++-4.6
Reading package lists... Done
Building dependency tree     
Reading state information... Done
0 upgraded, 0 newly installed, 5 reinstalled, 0 to remove and 7 not upgraded.
Need to get 0 B/19.6 MB of archives.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for libgcc1

Synaptic reports that libgcc1 is installed.

knudfl 11-15-2012 07:45 AM

Don't know what's happening. No issues here with libredwg / Mint 12, 64bits.

May be start from scratch in a new directory with :
git clone git://git.sv.gnu.org/libredwg.git

cd libredwg/ && chmod +x autogen.sh && ./autogen.sh &&
./configure --prefix=/usr/ --enable-trace && make

Or try out my result, libredwg-0.4.dev-mint12_amd64.deb
https://docs.google.com/open?id=0B7S...nY3Z3VpRXRMczg
$ sudo dpkg -i libredwg-0.4.dev-mint12_amd64.deb

.

cov 11-15-2012 08:55 AM

Still not working.

I've included some more of the output from ./configure in case there's something relevant.


Code:

checking whether we are cross compiling... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/home/dave/Documents/Projects/Programs/workspace/libredwg':
configure: error: C preprocessor "/lib/cpp" fails sanity check


knudfl 11-15-2012 02:30 PM

Probably reinstall some more of the compiler dependencies.

sudo apt-get install --reinstall libc6-dev linux-libc-dev

But then again, why build from source, when a package is available :
libredwg-0.4.dev-mint12_amd64.deb ( Link in post #9 ).

.

cov 11-16-2012 02:23 AM

Hi Knudfi,

Thanks very much for your efforts on this; they are much appreciated.

The reason I want to be able to compile the source is that I want to be able to use a step-through debugger to try to extract information from a dwg file, in particular a dwg CAD file from 2007 and later.

I am trying to follow the C code and work out how the file is read. The libredwg also segfaults with my files and I'd like to find out why that is.

So clearly a pre-compiled deb binary is not really going to be much use to me.

cov 11-18-2012 12:43 PM

I have Installed and compiled the source on another machine, so I am able to pursue my project.

However it does concern me a little that I can't compile on this machine. I guess I'll have to see if it affects the capability of the machine to install other software and address it if it does.

In any case, thank you for your efforts on this; I do appreciate it.

Many thanks,

Dave Coventry


All times are GMT -5. The time now is 11:47 PM.