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

"signal: killed" on driver import os Mac OS #93

Open
Bartuz opened this issue Aug 1, 2017 · 3 comments
Open

"signal: killed" on driver import os Mac OS #93

Bartuz opened this issue Aug 1, 2017 · 3 comments

Comments

@Bartuz
Copy link

Bartuz commented Aug 1, 2017

running my program without importing odbc gives me

sql: unknown driver "odbc" (forgotten import?)Tue Aug  1 02:27:00 WARNING  ImportCustomers: cannot connect to ExaSol DB: sql: unknown driver "odbc" (forgotten import?)

when I add

import(
_ "github.com/alexbrainman/odbc"
)

it returns

# path/vendor/github.com/alexbrainman/odbc/api
ld: warning: directory not found for option '-L/opt/local/lib'
ld: warning: directory not found for option '-L/opt/local/lib'
# path/vendor/github.com/alexbrainman/odbc/api
ld: warning: directory not found for option '-L/opt/local/lib'
ld: warning: directory not found for option '-L/opt/local/lib'
signal: killed

on compile time (no even first line from main() is executed).

golang version:

go version
go version go1.8.3 darwin/amd64

unixodb: 2.3.6

@alexbrainman
Copy link
Owner

I suspect your program does not even builds. Can you build it?
Doyou habe unixodbc installed? Where?
I suspect, cgo is trying to find unixodbc libraries, and cannot find them in /opt/local/lib.
Please try changing "#cgo darwin LDFLAGS" and "#cgo darwin CFLAGS" to include correct directories for where your unixodbc libs are stored.

Thank you.

Alex

@Bartuz
Copy link
Author

Bartuz commented Aug 2, 2017

  1. Can you build it?

yes I can. go build passes successfully, go run fails

  1. Doyou habe unixodbc installed? Where?

I have installed it with brew install along with freettds

brew info unixodbc
unixodbc: stable 2.3.4 (bottled)
ODBC 3 connectivity for UNIX
http://www.unixodbc.org/
Conflicts with:
  virtuoso (because Both install `isql` binaries.)
/usr/local/Cellar/unixodbc/2.3.4 (39 files, 959.6KB) *
  Poured from bottle on 2016-08-17 at 09:45:13
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/unixodbc.rb

tds:

 brew info freetds
freetds: stable 1.00.48 (bottled), HEAD
Libraries to talk to Microsoft SQL Server and Sybase databases
http://www.freetds.org/
/usr/local/Cellar/freetds/1.00.48 (2,094 files, 11.9MB) *
  Poured from bottle on 2017-08-01 at 13:48:51
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/freetds.rb
==> Dependencies
Build: pkg-config ✔
Recommended: openssl ✔
Optional: unixodbc ✔, libiodbc ✘
==> Options
--with-krb5
	Enable Kerberos support
--with-libiodbc
	Build with libiodbc support
--with-msdblib
	Enable Microsoft behavior in the DB-Library API where it diverges from Sybase's
--with-odbc-wide
	Enable odbc wide, prevent unicode - MemoryError's
--with-sybase-compat
	Enable close compatibility with Sybase's ABI, at the expense of other features
--with-unixodbc
	Build with unixodbc support
--without-openssl
	Build without openssl support
--HEAD
	Install HEAD version

. I have few issues with overriding CF and LDFLAGS. I'll play with a bit later. But log says it's only a warning, not an error

@alexbrainman
Copy link
Owner

Please, show me your program. Full text.
And what happens when you run. Please provide full output, and maybe add some println statements to determine where exactly your program fails.

Thank you.

Alex

PS: I see you use freetds. I suspect you are talking to MSSQL server. Did you try to use github.com/denisenkom/go-mssqldb ? github.com/denisenkom/go-mssqldb does not use CGO, so you have better chance making it work.

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

2 participants