Skip to content
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

fatal error: oci.h: No such file or directory #216

Open
vijayks040 opened this issue Sep 4, 2017 · 6 comments
Open

fatal error: oci.h: No such file or directory #216

vijayks040 opened this issue Sep 4, 2017 · 6 comments

Comments

@vijayks040
Copy link

vijayks040 commented Sep 4, 2017

go get -x gopkg.in/rana/ora.v4
WORK=C:\Users\vijay\AppData\Local\Temp\go-build685355070
mkdir -p $WORK\gopkg.in\rana\ora.v4_obj
mkdir -p $WORK\gopkg.in\rana
cd F:\SEARCHBLOX\searchblox\src\gopkg.in\rana\ora.v4
pkg-config --cflags oci8
pkg-config --libs oci8
CGO_LDFLAGS="-g" "-O2" "-LC:instantclient_12_2sdklibmsvc" "-LC:mingw64lib" "-loci" "C:\Go\pkg\tool\windows_amd64\cgo.exe" -objdir "C:\Users\vijay\AppData\Local\Temp\go-build685355070\gopkg.in\rana\ora.v4\_obj\" -importpath gopkg.in/rana/ora.v4 -- -IC:instantclient_12_2sdkinclude -IC:mingw64include -I "C:\Users\vijay\AppData\Local\Temp\go-build685355070\gopkg.in\rana\ora.v4\_obj\" -g -O2 bndBfile.go bndBin.go bndBinSlice.go bndBool.go bndBoolPtr.go bndBoolSlice.go bndDate.go bndDatePtr.go bndDateSlice.go bndFloat32.go bndFloat32Ptr.go bndFloat32Slice.go bndFloat64.go bndFloat64Ptr.go bndFloat64Slice.go bndInt16.go bndInt16Ptr.go bndInt16Slice.go bndInt32.go bndInt32Ptr.go bndInt32Slice.go bndInt64.go bndInt64Ptr.go bndInt64Slice.go bndInt8.go bndInt8Ptr.go bndInt8Slice.go bndIntervalDS.go bndIntervalDSSlice.go bndIntervalYM.go bndIntervalYMSlice.go bndLob.go bndLobPtr.go bndLobSlice.go bndNil.go bndNumString.go bndNumStringPtr.go bndNumStringSlice.go bndOCINum.go bndOCINumPtr.go bndOCINumSlice.go bndRset.go bndString.go bndStringPtr.go bndStringSlice.go bndTime.go bndTimePtr.go bndTimeSlice.go bndUint16.go bndUint16Ptr.go bndUint16Slice.go bndUint32.go bndUint32Ptr.go bndUint32Slice.go bndUint64.go bndUint64Ptr.go bndUint64Slice.go bndUint8.go bndUint8Ptr.go bndUint8Slice.go bnd_hlp.go conn.go conn_go1_8.go defBfile.go defBool.go defDate.go defFloat32.go defFloat64.go defInt16.go defInt32.go defInt64.go defInt8.go defIntervalDS.go defIntervalYM.go defLob.go defLongRaw.go defOCINum.go defRaw.go defRowid.go defRset.go defString.go defTime.go defUint16.go defUint32.go defUint64.go defUint8.go drv.go drvQueryResult.go env.go ora.go rset.go ses.go srv.go stmt.go tx.go util_arr.go

gopkg.in/rana/ora.v4

F:\SEARCHBLOX\searchblox\src\gopkg.in\rana\ora.v4\bndBfile.go:9:10: fatal error: oci.h: No such file or directory
#include <oci.h>
^~~~~~~
compilation terminated.

@nottest
Copy link

nottest commented Dec 12, 2017

Adding this two environment variables in my .bashrc helped resolve this issue:
export LD_LIBRARY_PATH=/usr/lib/oracle///lib:/usr/local/lib:/usr/lib64
export C_INCLUDE_PATH=/usr/include:/usr/lib/oracle///lib:/usr/include/oracle//:/usr/local/include

Once added make sure to source the file . e.g . .bashrc

@bootstrapsp
Copy link

bootstrapsp commented Oct 4, 2018

Running into exactly this on win10 pro x64

gopkg.in/rana/ora.v4
C:\goworkspace\src\gopkg.in\rana\ora.v4\bndBfile.go:9:10: fatal error: oci.h: No such file or directory
#include <oci.h>
^~~~~~~
compilation terminated.

My oracle is not on the same machine where I'm developing, I see that I do not have those two path set by @nottest , any hint what I should be setting for those?

@tgulacsi
Copy link
Collaborator

tgulacsi commented Oct 4, 2018

Use gopkg.in/goracle.v2 - that needs Oracle libs only at runtime, you can compile it on a machine without Oracle!

@bootstrapsp
Copy link

@tgulacsi thanks, tried that too still the same issue. :(

@bootstrapsp
Copy link

Btw i reconfirmed the sdk/include contains oci.h file,

here's my oci8.pc file content

`prefix=C:\instantclient_12_1\sdk

version=12.1
build=client64

libdir=${prefix}/lib
includedir=${prefix}/include

glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums

Name: oci8
Description: Oracle database engine
Version: ${version}
Libs: -L${libdir} -loci
Libs.private:
Cflags: -I${includedir}`

@bootstrapsp
Copy link

bootstrapsp commented Oct 4, 2018

Finally some progress - connection and query works if i update the OCI file to the following at least there is no fatal error about oci.h,

though I continue to get

runtime/cgo
gcc: warning: C:\instantclient_12_1\sdk\include: linker input file unused because linking not done

prefix=C://Oracleinstantclient_12_2//sdk
exec_prefix=C:////Oracleinstantclient_12_2////sdk
oralib=C://Oracleinstantclient_12_2//sdk//lib//msvc
orainclude=C://Oracleinstantclient_12_2//sdk//include
gcclib=C://msys64//mingw64//lib
gccinclude=C://msys64//mingw64//include
glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums

Name: oci8
Version: 12.2
Description: oci8 library
Libs: -LC://Oracleinstantclient_12_2//sdk//lib//msvc -LC://msys64//mingw64//lib -loci
Libs.private:
Cflags: -IC://Oracleinstantclient_12_2//sdk//include -IC://msys64//mingw64//include

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants