If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > static libmysqlclient.a isn't completely static?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-15-04, 01:35
diabelek diabelek is offline
Registered User
 
Join Date: Mar 2004
Posts: 1
static libmysqlclient.a isn't completely static?

Before I start, this is a compile problem (or so I think) and from what little I read in this forum, it looks ok to post. If not and you know the proper place to post, please let me know. Now for the good stuff....

I'm attempting to write a simple tool in C that needs to be compiled statically with mysql client support. It needs this (correct me if I'm wrong in what I say) because it will be used on the majority of Redhat'S and SuSE's OSes. Instead of compiling for each one of their glibc's and requiring that the mysql shared libraries are installed, I want to compile it once, statically for all of them (excluding the x86_64 and ia64).

When I run
----------------------------------------------------------------
CC = gcc
CFLAGS = -O2 -Wall -static
ALL:
gcc -O2 -Wall -static -o logger scsiInquiry.o sg_err.o sgScan.o logger.o /usr/lib/mysql/libmysqlclient.a
----------------------------------------------------------------

I get the following
--------------------------------------------------------------
/usr/lib/mysql/libmysqlclient.a(mf_pack.o)(.text+0x9ac): In function `expand_tilde':
: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x7a7): In function `read_user_name':
: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/mysql/libmysqlclient.a(mf_pack.o)(.text+0x9b9): In function `expand_tilde':
: Using 'endpwent' in statically linked applications requir....
----------------------------------------------------------------


I have little experience compiling statically so I am uncertain of the error messages are but I am reading it as the libmysqlclient.a wasn't compiled statically like I understood it to be. Is this so? If so, is there any way for me to compile my program statically without having to recompile libmysqlclient.a statically?

My ultimate goal is to be able to have this program run on all of my lab's machines and only using a single binary. Is this doable?


fyi:
the compile system is SuSE 9.0 x86 w/ mysql 4.0.15.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On