Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Stefan Schmidt
ruby-db2 extconf.rb -> can't locate libraries [ reply ]  
2006-05-11 20:34
hello,

i tried to setup ruby-db2 on my debian linux server but extconf.rb seems to have problems finding my installation of ibm db2 express-c in /opt/IBM/db2/V8.1 although the corresponding environment variable is set. i have attached the contents of mkmf.log for further information.

--------------------------------------------------
stefan@myserver:~$ set | grep ^DB2DIR
DB2DIR=/opt/IBM/db2/V8.1

stefan@myserver:~/sources/ruby-db2/ruby-db2-0.4.4$ ruby setup.rb setup
setup.rb:714: warning: don't put space before argument parentheses
entering setup phase...
/usr/bin/ruby1.8 extconf.rb
checking for SQLConnect() in -ldb2... no
ABORT: Could not locate DB2 libraries or headers!
Please set DB2DIR to your DB2 directory, e.g. /usr/IBMdb2/V7.1 (UNIX) or C:/SQLLIB (Windows)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
[...]
setup failed
'system /usr/bin/ruby1.8 extconf.rb' failed
try "ruby setup.rb --help" for usage

stefan@myserver:~/sources/ruby-db2/ruby-db2-0.4.4/ext/db2$ cat mkmf.log
have_library: checking for SQLConnect() in -ldb2... -------------------- no

"gcc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -I/opt/IBM/db2/V8.1/include -Wall -g -O2 -fPIC conftest.c -L"/opt/IBM/db2/V8.1/lib" -L"/usr/lib" -lruby1.8-static -ldb2 -lpthread -ldl -lcrypt -lm -lc"
conftest.c: In function `t':
conftest.c:4: warning: implicit declaration of function `SQLConnect'
/usr/lib/libc_nonshared.a(elf-init.oS)(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x0): In function `__i686.get_pc_thunk.bx':
: multiple definition of `__i686.get_pc_thunk.bx'
/tmp/cctV62oC.o(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x0):/home/stefan/sources/ruby-db2/ruby-db2-0.4.4/ext/db2/conftest.c:3: first defined here
collect2: ld returned 1 exit status
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { SQLConnect(); return 0; }
/* end */

"gcc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -I/opt/IBM/db2/V8.1/include -Wall -g -O2 -fPIC conftest.c -L"/opt/IBM/db2/V8.1/lib" -L"/usr/lib" -lruby1.8-static -ldb2 -lpthread -ldl -lcrypt -lm -lc"
conftest.c: In function `t':
conftest.c:5: error: `SQLConnect' undeclared (first use in this function)
conftest.c:5: error: (Each undeclared identifier is reported only once
conftest.c:5: error: for each function it appears in.)
checked program was:
/* begin */


/*top*/
int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return 0; }
/* end */

--------------------------------------------------

does this make sense to anyone ?

greetings, stefan