-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
C source files not allowed when not using cgo: sqlite3-binding.c #217
Comments
I read it (is in the README) after post this question but im not sure what exactly do on OSX. I already have the native Windows toolchain (it was installed with |
Am also seeing this error when running |
Same. Although, in my case I was trying to use the I manually removed all reference to go-sqlite3 (I'm using mysql) and was able to get goose working right away. So this is definitely an issue with this repo if you want to use it on linux amd64. |
This binding uses CGO and according to https://golang.org/cmd/cgo/ CGO is disabled by default when cross-compiling. You need to enable it explicitly by setting CGO_ENABLED=1 environment variable. |
👍 @kikht, I just had this issue and it's solved thanks to you ! 💝 |
@kikht +1 Tnx |
Hi, i have the same problem. If i set CGO_ENABLED=1 and compile for linux64 or win32 from my windows10, i have the following error:
Help :) |
@Fruchtgummi are you trying cross compiling? |
Yes, with others go-program it goes, but just now not with this sqlite. |
Then, you need to use cross compiler not host compiler. |
My cross-linux64.env `# cross-compiler linux amd64 GOROOT=c:\go GO15VENDOREXPERIMENT=1 PATH=C:\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0\mingw64\bin;%PATH% LITEIDE_GDB=gdb It that wrong? -> |
you need to use C-compiler that can generate ELF binary. Not go compiler. |
What? I use mingw-w64 and also provides ELF binary, I complie other GO programm with C-components -everything goes?? I only have trouble with sqlite3. |
Ah, I found this. So currently, you can do this on Windows. https://github.com/golang/go/blob/master/src/cmd/go/build.go#L3015-L3019 |
Compile Section Closes mattn#175 Compile Section Closes mattn#201 Compile Section Closes mattn#206 Compile Section Closes mattn#404 Compile Section Closes mattn#217 Compile Section Closes mattn#224 Compile Section Closes mattn#234 Compile Section Closes mattn#242 Feature table Closes mattn#255 Description Section Closes mattn#232 Golang:1.6 not supported Closes mattn#272 Golang:1.5 not supported + compilation section Closes mattn#283 usleep Implemented Closes mattn#285 FAQ Section Closes mattn#289 Compile Section closes mattn#295 FAQ Section Closes mattn#305 PR339 Closes mattn#318 mattn#321 Compilation Section Closes mattn#341 PR407 Closes mattn#364 Feature `sqlite_vtable` Closes mattn#393 Compile Section Closes mattn#416 sqlite_trace feature Closes mattn#433 Compilation Section Closes mattn#435 Compilation Section Closes mattn#443 Golang:1.6 Not Supported Closes mattn#445 Compilation Section Closes mattn#451 Compilation Section Closes mattn#467 Compilation Section Closes mattn#491 Compilation Section Closes mattn#495 Compilation Section Closes mattn#505 Compilation Section Closes mattn#557 Compilation Section Closes mattn#560
|
I create an application using this driver and works very well in OSX. Now i want to cross-compile for windows and after type
GOOS=windows GOARCH=386 go build
i get the following errorC source files not allowed when not using cgo: sqlite3-binding.c
I installed all the necessary dependencies through
goxc
and i cross-compile almost every day to windows. The mentioned issues happens when i use this driver.Any help appreciated.
The text was updated successfully, but these errors were encountered: