Skip to content

Failure to build under freebsd #533

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

Closed
greycubesgav opened this issue Feb 17, 2018 · 4 comments
Closed

Failure to build under freebsd #533

greycubesgav opened this issue Feb 17, 2018 · 4 comments

Comments

@greycubesgav
Copy link

greycubesgav commented Feb 17, 2018

Hi;
I'm getting a build error when trying to install under freebsd 10.3-STABLE

get github.com/mattn/go-sqlite
# github.com/mattn/go-sqlite3
sqlite3-binding.c:31162:42: error: use of undeclared identifier 'pread64'
sqlite3-binding.c:31180:42: error: use of undeclared identifier 'pwrite64'
sqlite3-binding.c:31304:22: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:31313:22: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:31340:20: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:31357:16: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:13164:38: note: expanded from macro 'ArraySize'
sqlite3-binding.c:31361:14: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:13164:38: note: expanded from macro 'ArraySize'
sqlite3-binding.c:33907:11: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
sqlite3-binding.c:31166:49: note: expanded from macro 'osPread64'
sqlite3-binding.c:34019:17: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
sqlite3-binding.c:31184:57: note: expanded from macro 'osPwrite64'

I get the same error with go install -x

Any thoughts on how to resolve?

Thanks

basvanbeek added a commit to basvanbeek/go-sqlite3 that referenced this issue Feb 17, 2018
@mattn mattn closed this as completed in bd9ec08 Feb 17, 2018
mattn added a commit that referenced this issue Feb 17, 2018
only enable pread/pwrite for linux. fixes #533 and fixes #532
@gsamat
Copy link

gsamat commented Nov 2, 2018

I get the same error when I try to do cross-compile from macOS to Linux.

env GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build try.go

# github.com/mattn/go-sqlite3
sqlite3-binding.c:32520:42: error: use of undeclared identifier 'pread64'
sqlite3-binding.c:32538:42: error: use of undeclared identifier 'pwrite64'
sqlite3-binding.c:32670:22: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:32679:22: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:32706:20: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:32723:16: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:13942:38: note: expanded from macro 'ArraySize'
sqlite3-binding.c:32727:14: error: invalid application of 'sizeof' to an incomplete type 'struct unix_syscall []'
sqlite3-binding.c:13942:38: note: expanded from macro 'ArraySize'
sqlite3-binding.c:35377:11: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
sqlite3-binding.c:32524:49: note: expanded from macro 'osPread64'
sqlite3-binding.c:35489:17: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
sqlite3-binding.c:32542:57: note: expanded from macro 'osPwrite64'

@gsamat
Copy link

gsamat commented Nov 2, 2018

Should I reopen this @mattn ?

@mattn
Copy link
Owner

mattn commented Nov 2, 2018

Do you use cross C compiler? If you use host C compiler, it will not be able to build for cross compiling.

@Seirdy
Copy link

Seirdy commented Sep 17, 2023

Also encounter this when building on Alpine Linux with Clang and musl libc

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