configure: error: cannot compute sizeof (char)

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ragbagken
Posts: 6
Joined: Fri, 2007-07-06, 09:06

configure: error: cannot compute sizeof (char)

#1 Post by ragbagken » Thu, 2008-07-17, 05:45

I am trying to compile DCMTK on sparc sun solaris2.8 gcc 2.95.3.

When I run "./Configure", it encounters an error:
checking size of char... configure: error: cannot compute sizeof (char), 77
It seems to bomb out of module config, and continues OK, but when I try "make all", it says
make: Warning: Can't find `config/Makefile.def': No such file or directory
make: Fatal error in reader: Makefile, line 8: Read of include file `config/Makefile.def' failed
Which I assume is because Makefile.def is not being created because of the first error.

I thought that maybe we need to use a different compiler, but CC or SC do not seem to be installed in this machine.

Thanks for any advice.

Here is the configure output:
adacp3u3.P3RTP <96>: ./configure
Running configure for module config.
checking build system type... sparc-sun-solaris2.8
checking host system type... sparc-sun-solaris2.8
checking whether make sets ${MAKE}... yes
checking for a BSD-compatible install... /opt/sfw/bin/ginstall -c
checking for gcc... gcc
checking for C compiler default output... 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 how to run the C preprocessor... gcc -E
checking for c++... c++
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking how to run the C++ preprocessor... c++ -E
checking for ranlib... ranlib
checking for ar... ar
checking for libtool... no
checking for AIX... no
checking for library containing strerror... none required
checking for long file names... yes
checking for inline... inline
checking for working const... yes
checking whether char is unsigned... no
checking whether right shift is unsigned... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking for uchar... no
checking for ushort... yes
checking for uint... yes
checking for ulong... yes
checking for longlong... no
checking for ulonglong... no
checking whether variable-length arrays are supported... yes
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking for stdint.h... (cached) no
checking for int64_t... yes
checking for uint64_t... yes
checking for working memcmp... yes
checking for vprintf... yes
checking for _doprnt... yes
checking return type of signal handlers... void
checking for wait3 that fills in rusage... no
checking for gethostname... yes
checking for gethostid... yes
checking for socket... no
checking for sysinfo... yes
checking for strchr... yes
checking for strstr... yes
checking for strtoul... yes
checking for itoa... no
checking for memcpy... yes
checking for memset... yes
checking for memmove... yes
checking for memcmp... yes
checking for bcopy... yes
checking for bcmp... yes
checking for getpid... yes
checking for mktemp... yes
checking for tempnam... yes
checking for tmpnam... yes
checking for getenv... yes
checking for mkstemp... yes
checking for stat... yes
checking for malloc_debug... no
checking for strerror... yes
checking for strdup... yes
checking for bzero... yes
checking for index... yes
checking for rindex... yes
checking for access... yes
checking for uname... yes
checking for cuserid... yes
checking for getlogin... yes
checking for usleep... yes
checking for flock... no
checking for lockf... yes
checking for listen... no
checking for connect... no
checking for setsockopt... no
checking for getsockopt... no
checking for select... yes
checking for gethostbyname... no
checking for bind... no
checking for accept... no
checking for getsockname... no
checking for waitpid... yes
checking for getuid... yes
checking for geteuid... yes
checking for setuid... yes
checking for getpwnam... yes
checking for getgrnam... yes
checking for sleep... yes
checking for fork... yes
checking for _findfirst... no
checking for strlcpy... yes
checking for strlcat... yes
checking for finite... yes
checking for isinf... no
checking for isnan... yes
checking whether to compile in debug mode... no
checking whether to enable thread support... automatic detection
checking for -lg++... no
checking for main in -liostream... no
checking for main in -lnsl... yes
checking for main in -lsocket... yes
checking for main in -ldl... yes
checking for main in -lm... yes
checking for main in -lwsock32... no
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking netinet/in_systm.h usability... yes
checking netinet/in_systm.h presence... yes
checking for netinet/in_systm.h... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking alloca.h usability... yes
checking alloca.h presence... yes
checking for alloca.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking fnmatch.h usability... yes
checking fnmatch.h presence... yes
checking for fnmatch.h... yes
checking fstream usability... yes
checking fstream presence... yes
checking for fstream... yes
checking fstream.h usability... yes
checking fstream.h presence... yes
checking for fstream.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking ieeefp.h usability... yes
checking ieeefp.h presence... yes
checking for ieeefp.h... yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking iomanip usability... yes
checking iomanip presence... yes
checking for iomanip... yes
checking iomanip.h usability... yes
checking iomanip.h presence... yes
checking for iomanip.h... yes
checking iostream usability... yes
checking iostream presence... yes
checking for iostream... yes
checking iostream.h usability... yes
checking iostream.h presence... yes
checking for iostream.h... yes
checking iso646.h usability... yes
checking iso646.h presence... yes
checking for iso646.h... yes
checking libc.h usability... no
checking libc.h presence... no
checking for libc.h... no
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking new.h usability... yes
checking new.h presence... yes
checking for new.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking semaphore.h usability... yes
checking semaphore.h presence... yes
checking for semaphore.h... yes
checking setjmp.h usability... yes
checking setjmp.h presence... yes
checking for setjmp.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking sstream usability... yes
checking sstream presence... yes
checking for sstream... yes
checking sstream.h usability... no
checking sstream.h presence... no
checking for sstream.h... no
checking stat.h usability... no
checking stat.h presence... no
checking for stat.h... no
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdint.h... (cached) no
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking strstrea.h usability... no
checking strstrea.h presence... no
checking for strstrea.h... no
checking strstream usability... yes
checking strstream presence... yes
checking for strstream... yes
checking strstream.h usability... yes
checking strstream.h presence... yes
checking for strstream.h... yes
checking synch.h usability... yes
checking synch.h presence... yes
checking for synch.h... yes
checking sys/errno.h usability... yes
checking sys/errno.h presence... yes
checking for sys/errno.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for sys/stat.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking sys/utime.h usability... yes
checking sys/utime.h presence... yes
checking for sys/utime.h... yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking thread.h usability... yes
checking thread.h presence... yes
checking for thread.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking unix.h usability... no
checking unix.h presence... no
checking for unix.h... no
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking if pthread_t is a pointer type (in pthread.h)... no
checking for sema_init in -lthread... yes
checking multi-thread support... yes, solaris threads
checking for size_t... yes
checking for ssize_t... yes
checking for pid_t... yes
checking whether char is unsigned... no
checking for char... yes
checking size of char... configure: error: cannot compute sizeof (char), 77
Running configure for module dcmdata.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmimage.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmimgle.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmjpeg.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./libijg8/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./libijg12/Makefile
config.status: creating ./libijg16/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmnet.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmpstat.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./jni/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmqrdb.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmsign.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmsr.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmtls.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module dcmwlm.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./apps/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./wwwapps/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module ofstd.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./etc/Makefile
config.status: creating ./docs/Makefile
config.status: creating ./tests/Makefile
config.status: creating ./Makefile
config.status: creating ./libsrc/Makefile
config.status: creating ./include/Makefile
Running configure for module doxygen.
running configure for this module
checking whether make sets ${MAKE}... yes
confmod: creating ./config.status
config.status: creating ./Makefile
adacp3u3.P3RTP <97>: make all
make: Warning: Can't find `config/Makefile.def': No such file or directory
make: Fatal error in reader: Makefile, line 8: Read of include file `config/Makefile.def' failed
adacp3u3.P3RTP <98>:

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1225
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg » Thu, 2008-07-17, 08:51

An error during the execution of the configure script in module config will indeed cause Makefile.def not to be generated and will prevent compilation of any module of the toolkit. All other configure scripts only generate Makefiles that "point" to the central header files and makefiles in module config, which is the only purpose of module config.

One would be tempted to say that a C++ compiler that cannot determine sizeof(char) is pretty stupid since the sizeof(char) == 1 is true by definition.

In this case I would guess that the configure script fails to run either the compiler, the linker, or the compiled test program - check config/configure.log for details. This could be a problem with environment variables or the like.

ragbagken
Posts: 6
Joined: Fri, 2007-07-06, 09:06

#3 Post by ragbagken » Fri, 2008-07-18, 01:15

Hi Marco,

Thank you for your reply. Googling around it seems that the problem is with Unicode, which would make sense as the size of a char may be 16 bits on a multi-byte system.

I have installed "libiconv" from Sunfreeware.com and added "/usr/local/lib" and "/opt/sfw/lib" to LD_LIBRARY_PATH, but it still didn't work.

I suspect that the problem is with the installation of "libiconv", but I have no idea how to check this.

Thank you again for any ideas.

-Ken Sutherland
Hokkaido University Hospital

[removed overly long listings -mod]

ragbagken
Posts: 6
Joined: Fri, 2007-07-06, 09:06

#4 Post by ragbagken » Fri, 2008-07-18, 01:26

Here is the rest of config.log
configure:9600: checking ieeefp.h presence
configure:9607: c++ -E conftest.cc
configure:9613: $? = 0
configure:9631: result: yes
configure:9649: checking for ieeefp.h
configure:9656: result: yes
configure:9683: checking io.h usability
configure:9692: c++ -c -Wall -pedantic conftest.cc >&5
configure:9720: io.h: No such file or directory
configure:9695: $? = 1
configure: failed program was:
[shortened overly long listing -mod]

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1225
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#5 Post by Marco Eichelberg » Fri, 2008-07-18, 08:23

The problem is here:

Code: Select all

configure:16523: c++ -o conftest -D_REENTRANT -Wall -pedantic conftest.cc -lthread -lsocket -lnsl >&5
configure:16526: $? = 0
configure:16528: ./conftest
ld.so.1: conftest: fatal: libstdc++.so.2.10.0: open failed: No such file or directory
./configure: line 1: 7048 Killed
Obviously the configure script is unable to run the test program it has generated because on your machine libstdc++ is not correctly installed, or the LD_LIBRARY_PATH is wrong.

ragbagken
Posts: 6
Joined: Fri, 2007-07-06, 09:06

#6 Post by ragbagken » Tue, 2008-07-22, 00:43

OK. Thank you, Marco. I'll look into it.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest