Open Bartuz opened 7 years ago
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
yes I can.
go build
passes successfully, go run fails
I have installed it with
brew install
along with freettdsbrew 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
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.
running my program without importing odbc gives me
when I add
it returns
on compile time (no even first line from main() is executed).
golang version:
unixodb: 2.3.6