LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-08-2008, 10:45 PM   #1
RooZ
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
error: cannot compute sizeof (short)


I'm trying to compile a program which requires MySQL to work properly, except I keep getting the error:
Code:
checking size of short... configure: error: cannot compute sizeof (short), 77
The log says:
Code:
configure:20803: checking size of short
configure:21122: gcc -o conftest -g -O2 -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv   -L/usr/lib/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib -lssl -lcrypto -lmystrings conftest.c  >&5
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
configure:21125: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE "xbtt"
| #define VERSION "1.0.0"
| #define BUILD_DATE "Sat Aug  9 05:21:51 CEST 2008"
| #ifdef __cplusplus
| extern "C" void std::exit (int) throw (); using std::exit;
| #endif
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_EPOLL_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_ERRNO_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_ZLIB_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| #  include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| long longval () { return (long) (sizeof (short)); }
| unsigned long ulongval () { return (long) (sizeof (short)); }
| #include <stdio.h>
| #include <stdlib.h>
| int
| main ()
| {
|
|   FILE *f = fopen ("conftest.val", "w");
|   if (! f)
|     exit (1);
|   if (((long) (sizeof (short))) < 0)
|     {
|       long i = longval ();
|       if (i != ((long) (sizeof (short))))
|       exit (1);
|       fprintf (f, "%ld\n", i);
|     }
|   else
|     {
|       unsigned long i = ulongval ();
|       if (i != ((long) (sizeof (short))))
|       exit (1);
|       fprintf (f, "%lu\n", i);
|     }
|   exit (ferror (f) || fclose (f) != 0);
|
|   ;
|   return 0;
| }
configure:21140: error: cannot compute sizeof (short), 77
I haven't the slightest idea how to fix it
 
Old 08-09-2008, 09:05 AM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
You need to install the mysqlclient dev package (on debian it's libmysqlclient15-dev). The reason it can't compute the sizeof short is because the link fails on the test program.

/usr/bin/ld: cannot find -lmysqlclient_r

Last edited by estabroo; 08-09-2008 at 09:06 AM. Reason: clarification
 
  


Reply



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
Configure: error: cannot compute sizeof (long double) in glibc pass 2 irfanali Linux From Scratch 29 02-03-2010 06:48 AM
mkreiserfs compute error? uselpa Slackware 1 06-16-2005 04:29 PM
sizeof() function error ??? Quest101 Programming 9 03-10-2005 09:35 PM
./configure fails trying to install SynCE/libraki - cannot compute sizeof (void *) dizzutch Linux - Software 0 12-27-2004 02:18 PM
error when installing gift: error: cannot compute sizeof (short), 77 v1pEr Linux - Software 5 11-04-2004 02:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:14 AM.

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
Open Source Consulting | Domain Registration