rana / ora

An Oracle database driver in Go.
MIT License
271 stars 65 forks source link

ora.v4.a: error adding symbols: Archive has no index; run ranlib to add one #220

Open amiracam opened 7 years ago

amiracam commented 7 years ago

error : C:\Users\amira\Documents\GoProjects\TestDBAccess\src\C>gcc -shared -pthread -o testdb.dll dummy.c testdb.a ora.v4.a num.a date.a -lWinMM -lntdll -lWS2_32 ora.v4.a: error adding symbols: Archive has no index; run ranlib to add one collect2.exe: error: ld returned 1 exit status

I'm using CGO buildmodes for the purposes of generating a C program that integrates our GO libraries that in turn leverage database/sql.

Is this a matter where there are some directives in the oci8.pc file that could be included that would generate the needed index ? btw, running ranlib had no effect.

Not a C guy, new to GO , thank you for your help.

tgulacsi commented 7 years ago

Neither a C guy... AFAIK Oracle does not provide static lib - I don't know whether this is a problem, just a fact.

gopkg.in/goracle.v2 uses ODPI-C, includes that, and that uses dl to load the Oracle client dynamically at runtime. Maybe that'd help.

amiracam notifications@github.com ezt írta (időpont: 2017. szept. 14., Cs, 19:05):

error : C:\Users\amira\Documents\GoProjects\TestDBAccess\src\C>gcc -shared -pthread -o testdb.dll dummy.c testdb.a ora.v4.a num.a date.a -lWinMM -lntdll -lWS2_32 ora.v4.a: error adding symbols: Archive has no index; run ranlib to add one collect2.exe: error: ld returned 1 exit status

I'm using CGO buildmodes for the purposes of generating a C program that integrates our GO libraries that in turn leverage database/sql.

Is this a matter where there are some directives in the oci8.pc file that could be included that would generate the needed index ? btw, running ranlib had no effect.

Not a C guy, new to GO , thank you for your help.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rana/ora/issues/220, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPoSpdwYNCQ8RLhBofXZ8JJ0nGoFo8Eks5siVzBgaJpZM4PX5V2 .

amiracam commented 7 years ago

and so besides that , what are the differences between that driver and the rana/ora ? thanks

tgulacsi commented 7 years ago

goracle.v2 is a pure database/sql driver - as with Go 1.9, we no longer need the driver-specific extensions as in ora.v4 (Ses). The other difference is that goracle.v2 uses ODPI-C, an easier-to-use wrapper for OCI. A side effect is that you no longer need Instant Client for development, only for running, as ODPI loads the libclntsh.so at runtime.

amiracam commented 7 years ago

and I can confirm that it works in Windows well. To elaborate we NOT just "using" goracle in a normal GO app context i.e. what we are doing is porting our ProC code to use GO based DB connectivity by using CGO so that we can from our C code call the CGO/database/sql libs instead of Oracle's embedded SQL (ProC) thus allowing us to have DB independence