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

compilation of app for i386 arch "undefined: SQLiteConn" #483

Closed
avecost opened this issue Nov 17, 2017 · 16 comments
Closed

compilation of app for i386 arch "undefined: SQLiteConn" #483

avecost opened this issue Nov 17, 2017 · 16 comments

Comments

@avecost
Copy link

avecost commented Nov 17, 2017

no problem compiling the app for 64-bit arch, but when i set GOARCH=386 running go build this error is reported:

sqlite3_go18.go:18:10: undefined: SQLiteConn

@mattn
Copy link
Owner

mattn commented Nov 17, 2017

You need to install cross-C-compiler for 386.

@avecost
Copy link
Author

avecost commented Nov 17, 2017

Hello Mattn,

I have already install GCC v7.2.0, still encountering the same error.

Maybe it would help if I mention I'm using Windows 10 64-bit

Thanks

@mattn
Copy link
Owner

mattn commented Nov 17, 2017

please show me your go env?

@avecost
Copy link
Author

avecost commented Nov 17, 2017

image

@avecost
Copy link
Author

avecost commented Nov 17, 2017

Im sorry i uploaded an image.. i dont know how to paste a formatted text

@mattn
Copy link
Owner

mattn commented Nov 17, 2017

try set CGO_ENABLED=1

@elico
Copy link

elico commented Nov 19, 2017

github.com/mattn/go-sqlite3

../../go/src/github.com/mattn/go-sqlite3/sqlite3_go18.go:18:10: undefined: SQLiteConn

WIth CGO_ENABLED=1 I get:

# runtime/cgo
In file included from /usr/include/features.h:399:0,
                 from /usr/include/stdlib.h:24,
                 from _cgo_export.c:2:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
                           ^

@mattn
Copy link
Owner

mattn commented Nov 19, 2017 via email

@elico
Copy link

elico commented Nov 19, 2017

@mattn I am using Debian\Ubutnu , can you give me a hint on what might be the right package for this?
I have seen these docker containers:
https://github.com/dockcross/dockcross

But yet to understand how to use them.

@mattn
Copy link
Owner

mattn commented Nov 20, 2017

sudo apt install gcc-mingw-w64-i686

and please point $CC to the compiler.

@avecost
Copy link
Author

avecost commented Nov 20, 2017

compiling on windows 10 64-bit for my app to run on 386:

with CGO_ENABLED=1

encountered "skipping incompatible.." errors

this is using mingw-w64 compiler

@mattn
Copy link
Owner

mattn commented Nov 20, 2017

there are two compilers w64 and i686. you need to install i686 version.

@avecost
Copy link
Author

avecost commented Nov 20, 2017

Thank you for your patience and great help @mattn upon checking my BIOS Virtualization is not enabled. Upon enabling it the compilation works perfectly.

@avecost avecost closed this as completed Nov 20, 2017
@mattn
Copy link
Owner

mattn commented Nov 20, 2017

good to hear. 👍

@hatuan
Copy link

hatuan commented Jan 23, 2018

I am on windows and build mattn/go-sqlite3 for linux
If set CGO_ENABLED=0 I have error

sqlite3_go18.go:18:10: undefined: SQLiteConn

If set CGO_ENABLED=1 I have error

runtime/cgo

gcc_linux_amd64.c: In function '_cgo_sys_thread_start':
gcc_linux_amd64.c:62:2: error: unknown type name 'sigset_t'; did you mean '_sigset_t'?
sigset_t ign, oset;
^~~~~~~~
_sigset_t
gcc_linux_amd64.c:67:2: error: implicit declaration of function 'sigfillset' [-Werror=implicit-function-declaration]
sigfillset(&ign);
^~~~~~~~~~
gcc_linux_amd64.c:62:16: error: unused variable 'oset' [-Werror=unused-variable]
sigset_t ign, oset;
^~~~
cc1.exe: all warnings being treated as errors

What happen with me?
I am using mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1

@mattn
Copy link
Owner

mattn commented Jan 23, 2018

go-sqlite3 is cgo package. CGO_ENABLED=1 is required.

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

4 participants