-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Master (b9bac3eb00c30a84f75e9ca67f422600de5552c8) does not compile #136
Comments
With this patch, it compiles:
|
Hi @tgulacsi FWIW here is doc on how we are exposing the new library loading functionality in node-oracledb and cx_Oracle: https://github.com/oracle/node-oracledb/blob/master/doc/api.md#odbinitoracleclient, https://github.com/oracle/node-oracledb/blob/master/doc/api.md#initnodeoracledb, https://github.com/oracle/python-cx_Oracle/blob/master/doc/src/user_guide/initialization.rst |
@cjbj sorry, I don't understand: those nice docs only mention installing, and not C compiling issues... |
@tgulacsi it was just an FYI if you were playing with the library loading code. |
@tgulacsi, what platform and compiler are you using? dlfcn.h is what defines the structure Dl_info and is already present -- but that may be specific to the configurations I am using. The two suggested changes do not appear to be dealing with the same matter. Can you clarify? |
See https://github.com/godror/godror/tree/odpi-v4
but ODPI-C v3.3.0 works flawlessly:
|
@tgulacsi Could you add the following code to #ifdef __GNUC__
#error __GNUC__ is defined.
#else
#error __GNUC__ isn't defined.
#endif I guess that I think that this line should check @tgulacsi Could you check the following code also to check whether #ifdef __linux__
#error __linux__ is defined.
#else
#error __linux__ is not defined.
#endif |
On 06/16/2020 1:33 PM Kubo Takehiro ***@***.***> wrote:
@tgulacsi (https://github.com/tgulacsi) Could you add the following code to dpiImpl.h and check the error message?
#ifdef __GNUC__
#error __GNUC__ is defined.
#else
#error __GNUC__ isn't defined.
#endif
I guess that __GNUC__ isn't defined in cgo so _GNU_SOURCE isn't defined here (https://github.com/oracle/odpi/blob/b6f2b14b92e74239516edb01f2c55199e4067019/src/dpiImpl.h#L22-L26). When _GNU_SOURCE is defined before #include <dlfcn.h>, Dl_info is available. See SYNOPSIS in the dladdr man page (https://www.man7.org/linux/man-pages/man3/dladdr.3.html).
I think that this line (https://github.com/oracle/odpi/blob/b6f2b14b92e74239516edb01f2c55199e4067019/src/dpiImpl.h#L24) should check __linux__ instead of __GNUC__. That's because gcc is available not only on Linux but also on other platforms such as Solaris. If _GNU_SOURCE is defined on Solaris, it causes trouble here (https://github.com/oracle/odpi/blob/b6f2b14b92e74239516edb01f2c55199e4067019/src/dpiError.c#L259-L263).
@tgulacsi (https://github.com/tgulacsi) Could you check the following code also to check whether __linux__ is defined in cgo.
#ifdef __linux__
#error __linux__ is defined.
#else
#error __linux__ is not defined.
#endif
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#136 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAB6QSV2IML2ODZ2HBAS273RW5J7RANCNFSM4NZCPM5Q).
! go clean -cache ; go install
# github.com/godror/godror
In file included from ./conn.go:10:
./odpi/src/dpiImpl.h:23:2: error: #error __linux__ is defined.
23 | #error __linux__ is defined.
| ^~~~~
./odpi/src/dpiImpl.h:29:2: error: #error __GNUC__ is defined.
29 | #error __GNUC__ is defined.
| ^~~~~
|
TL;DR; first define macros, then include libs. This was the solution:
Sorry for the noise, thanks for the suggestions! |
Thanks. My guess is incorrect.
That’s correct. |
I believe I have addressed the suggestion made by @kubo. Instead of |
Edited: strike-through line was added. |
I'm not using |
Sorry, I looked a bit old code. I missed this commit. I found another issue about |
I opened #138 to report a As for mingw-w64, there are no problems. I thought that ODPI-C cannot be compiled because mingw-w64 doesn't implement |
odpi/src/dpiOci.c
Line 1799 in b9bac3e
Where is Dl_info defined?
I've tried to compile with godror, but fails:
Then I searched for Dl_info in this repo, but it's only in dpiOci.c...
The text was updated successfully, but these errors were encountered: