Comments (11)
Probably, your sqlite3.pc contains gcc's feature not clang's one. And I noticed your build log contains pkg-config outputs. go-sqlite3 doesn't use pkg-config any more.
from go-sqlite3.
I tried it again and the pkg-config outputs are gone. The error is the same. It seems this could be a bug in cgo:
https://groups.google.com/forum/#!topic/golang-dev/H3FCUAlc6BU
If I add "-Qunused-arguments" to CFLAGS like it's suggested on stackoverflow, I'm just getting a lot of errors like: "could not determine kind of name for C.sqlite3_column_count"
http://stackoverflow.com/questions/17319635/compile-c-packages-on-osx-10-9
from go-sqlite3.
This appears to be a bug in cgo that does not look like it's going to be resolved soon. However, installing gcc-4.2 (the last "real" gcc) and putting it before /usr/bin/gcc
in my PATH
appears to have solved the problem.
EDIT: Also, passing -ldflags -linkmode=external
as an argument to go build
(or whatever) was necessary to force the native linker (which is necessary to link to the sqlite3 library).
from go-sqlite3.
I'm hitting this, too.
[colin@kid ~]$ go get github.com/mattn/go-sqlite3
# github.com/mattn/go-sqlite3
clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'
Versions:
[colin@kid ~]$ go version
go version go1.1.2 darwin/amd64
[colin@kid ~]$ clang --version
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
[colin@kid ~]$ gcc-4.2 --version
i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[colin@kid ~]$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
[colin@kid ~]$ which gcc
/usr/bin/gcc
[colin@kid ~]$ ls -lan `which gcc`
-rwxr-xr-x 1 0 80 35472 Sep 29 13:15 /usr/bin/gcc
[colin@kid ~]$ which clang
/usr/local/bin/clang
from go-sqlite3.
According to this comment, this is fixed in 1.2 as well as HEAD.
from go-sqlite3.
I installed Go HEAD and confirmed that this error no longer occurs.
from go-sqlite3.
I can confirm this is a issue with the installed gcc for OSX. I am on 10.8, Go 1.1.2.
Fix for the issue:
- install
gcc
with homebrew - move
/usr/local/bin
is at the top of/etc/paths
, if not already. (Open a new terminal after) - Navigate to
/usr/local/bin
and runsudo ln -s gcc-4.x gcc
, makes sure that you put in the version of gcc that you are using.
This resolved the issue for me.
P.S
you may have to run go install -ldflags -linkmode=external
to use the new version of gcc
correctly
from go-sqlite3.
Cool. So I can close this issue on the release of 1.2 ?
from go-sqlite3.
@mattn I think so. The issue is not with your library. I left my instructions for historical purposes.
from go-sqlite3.
There is a way to avoid symlinking by creating an alias in .bash_profile
alias go="env CC=GCC-4.2 go"
Go will use proper gcc compiler and other things won't be affected.
from go-sqlite3.
Same as with #95, this has been fixed in Go 1.2 (I am using 10.9.1)
from go-sqlite3.
Related Issues (20)
- Out of order `$n` params get incorrect values HOT 2
- difference between linux build vs libsqlite3 linux HOT 1
- backup.go:6:214: illegal UTF-8 encoding
- package using go-sqlite3 fails to compile HOT 1
- how to register sqlite3_busy_handler function ?
- Error "no such table" when creating temp tables HOT 3
- undefined: sqlite3.Error HOT 1
- Possible solutions to the concurrency problems HOT 10
- Why does the compilation freeze after importing go-sqlite3 HOT 6
- Installation Failed? HOT 2
- [Want help] examples of virtual table's Update method HOT 3
- [Want help] How to use compiled go-sqlite3 on Windows? HOT 6
- RETURNING directive is not working. HOT 1
- strange disk I/O error: read-only file system, need help HOT 5
- Performance when not using build tag "libsqlite3" HOT 2
- Making Virtual Table Implementation Multi Tenant HOT 2
- Ordering of query parameters HOT 1
- gcc dependency removel HOT 1
- LastInsertId and RowsAffected methods of sqlite.Result object return constant nil error HOT 1
- SIGSEGV when create a table HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sqlite3.