kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

Trying to build on cygwin 32bit #121

Closed txdv closed 7 years ago

txdv commented 8 years ago

I am trying to build the gem on a Windows 7 64bit, cygwin 32bit system, ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-cygwin], I downloaded the 10.2.0.5.0 basic, sdk and sqlplus packages, I got around a few errors, but I'm hitting a wall with OCIEnvCreate:


SQL*Plus: Release 10.2.0.5.0 - Production on Wed Mar 16 11:46:01 2016
have_func: checking for OCIEnvCreate() in oci.h... -------------------- no

"gcc -o conftest.exe -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I.    -ggdb -O2 -pipe -Wimplicit-function-declaration   "-I/home/andrius.bentkus/oracle/instantclient_10_2//OCI/INCLUDE" -D_int64="long long" conftest.c  -L. -L/usr/lib -L. -fstack-protector     -L/usr/lib -L. -lOCI -lruby220  -L/usr/lib -L. -lOCI -lpthread -lgmp -ldl -lcrypt  "
/tmp/ccw4fIp1.o: In function `t':
/home/andrius.bentkus/.gem/ruby/gems/ruby-oci8-2.2.1/ext/oci8/conftest.c:15: undefined reference to `OCIEnvCreate'
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <oci.h>
 4:
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     printf("%p", &t);
11:   }
12:
13:   return 0;
14: }
15: int t(void) { void ((*volatile p)()); p = (void ((*)()))OCIEnvCreate; return 0; }
/* end */

"gcc -o conftest.exe -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I.    -ggdb -O2 -pipe -Wimplicit-function-declaration   "-I/home/andrius.bentkus/oracle/instantclient_10_2//OCI/INCLUDE" -D_int64="long long" conftest.c  -L. -L/usr/lib -L. -fstack-protector     -L/usr/lib -L. -lOCI -lruby220  -L/usr/lib -L. -lOCI -lpthread -lgmp -ldl -lcrypt  "
conftest.c: In function ‘t’:
conftest.c:15:15: error: too few arguments to function ‘OCIEnvCreate’
 int t(void) { OCIEnvCreate(); return 0; }
               ^
In file included from /home/andrius.bentkus/oracle/instantclient_10_2//OCI/INCLUDE/oci.h:2713:0,
                 from conftest.c:3:
/home/andrius.bentkus/oracle/instantclient_10_2//OCI/INCLUDE/ociap.h:6424:9: note: declared here
 sword   OCIEnvCreate (OCIEnv **envp, ub4 mode, dvoid *ctxp,
         ^
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <oci.h>
 4:
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     printf("%p", &t);
11:   }
12:
13:   return 0;
14: }
15: int t(void) { OCIEnvCreate(); return 0; }
/* end */
--------------------

It just cant find OCIEnvCreate, although it is defined in the oci.h:

#define OCIEnvCreate               ocienvct

Maybe it doesn't find the pointer first because it is a define? The other time the amount of arugments is just not right os it just fails.

Any insights on the error and how I can circumvent it?

kubo commented 8 years ago

Could you check OCI.def created by oraconf.rb whether it includes OCIEnvCreate?

I got around a few errors

What errors did you get around? It might be, perhaps, important.

After you get around the OCIEnvCreate issue, you will hit a next wall reported by #113. You need to replace three files in the trunk.

kubo commented 7 years ago

close this issue because of no response.