Giter Club home page Giter Club logo

Comments (11)

mattn avatar mattn commented on May 22, 2024

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.

graetzer avatar graetzer commented on May 22, 2024

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.

duane avatar duane commented on May 22, 2024

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.

colindean avatar colindean commented on May 22, 2024

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.

colindean avatar colindean commented on May 22, 2024

According to this comment, this is fixed in 1.2 as well as HEAD.

from go-sqlite3.

colindean avatar colindean commented on May 22, 2024

I installed Go HEAD and confirmed that this error no longer occurs.

from go-sqlite3.

dwa012 avatar dwa012 commented on May 22, 2024

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:

  1. install gcc with homebrew
  2. move /usr/local/bin is at the top of /etc/paths, if not already. (Open a new terminal after)
  3. Navigate to /usr/local/bin and run sudo 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.

mattn avatar mattn commented on May 22, 2024

Cool. So I can close this issue on the release of 1.2 ?

from go-sqlite3.

dwa012 avatar dwa012 commented on May 22, 2024

@mattn I think so. The issue is not with your library. I left my instructions for historical purposes.

from go-sqlite3.

abugrov avatar abugrov commented on May 22, 2024

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.

adamlazz avatar adamlazz commented on May 22, 2024

Same as with #95, this has been fixed in Go 1.2 (I am using 10.9.1)

from go-sqlite3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.