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

Undefined references on install #5

Closed
Kukulkano opened this issue Sep 15, 2023 · 9 comments
Closed

Undefined references on install #5

Kukulkano opened this issue Sep 15, 2023 · 9 comments

Comments

@Kukulkano
Copy link

Kukulkano commented Sep 15, 2023

Hi. I follow the documentation and run

go get github.com/webui-dev/go-webui/v2@latest

Sadly, it fails:

# github.com/webui-dev/go-webui/v2
../../../go/pkg/mod/github.com/webui-dev/go-webui/v2@v2.4.0/webui-linux-gcc-x64/libwebui-2-static.a(civetweb.o): In function `set_non_blocking_mode':
civetweb.c:(.text+0x4ff): undefined reference to `fcntl64'
civetweb.c:(.text+0x51b): undefined reference to `fcntl64'
../../../go/pkg/mod/github.com/webui-dev/go-webui/v2@v2.4.0/webui-linux-gcc-x64/libwebui-2-static.a(civetweb.o): In function `fclose_on_exec':
civetweb.c:(.text+0x3fe4): undefined reference to `fcntl64'
../../../go/pkg/mod/github.com/webui-dev/go-webui/v2@v2.4.0/webui-linux-gcc-x64/libwebui-2-static.a(civetweb.o): In function `set_close_on_exec.constprop.0':
civetweb.c:(.text+0x453e): undefined reference to `fcntl64'
../../../go/pkg/mod/github.com/webui-dev/go-webui/v2@v2.4.0/webui-linux-gcc-x64/libwebui-2-static.a(civetweb.o): In function `close_connection':
civetweb.c:(.text+0xae12): undefined reference to `fcntl64'
../../../go/pkg/mod/github.com/webui-dev/go-webui/v2@v2.4.0/webui-linux-gcc-x64/libwebui-2-static.a(civetweb.o):civetweb.c:(.text+0xae2a): more undefined references to `fcntl64' follow
collect2: error: ld returned 1 exit status

Any idea what is wrong? How can I fix this?

I'm on Linux (x86-64) using go1.16.2 linux/amd64.

@hassandraga
Copy link
Member

hassandraga commented Sep 15, 2023

I just test it this morning in Windows and it works fine:

> go get github.com/webui-dev/go-webui/v2@latest
go: downloading github.com/webui-dev/go-webui/v2 v2.4.0
go: upgraded github.com/webui-dev/go-webui/v2 v2.3.2 => v2.4.0

> go build minimal.go

> minimal.exe

I will re-test it in Linux later today.

@hassandraga
Copy link
Member

According to this issue, they make a hack as a workaround. In general, WebUI uses Civetweb, and Civetweb includes <fcntl.h>, which may not be compatible with your GLibc version.

What is the version of GLIBC installed on your machine? You can use ldd --version command or a similar one.

@Kukulkano
Copy link
Author

Kukulkano commented Sep 15, 2023

> ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27

I'm on KDE NEON 5.19 (basically Ubuntu 20.04 LTS) and just ran all updates (apt get update, apt get upgrade).

@hassandraga
Copy link
Member

in glibc 2.28+ and _FILE_OFFSET_BITS=64 fcntl is #define'd to fcntl64
Thus headers say fcntl64 exists, but libc.so.6 (the old one) disagrees

I guess we need to apply the same hack they did. I will investigate.

@hassandraga
Copy link
Member

I just test it using Ubuntu 22.04.2 LTS with ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35. it works fine.

@ttytm
Copy link
Member

ttytm commented Sep 25, 2023

Most part of the wrapper was re-written for the upcoming release. Can you re-check if the issue is solved for you @Kukulkano ?
The go get command changed to: go get github.com/webui-dev/go-webui@latest

@hassandraga
Copy link
Member

Perhaps we should change #cgo windows to #cgo windows,amd64 so Go builder knows that ARM lib does not exist.
@ttytm

@ttytm
Copy link
Member

ttytm commented Sep 25, 2023

Yes, sounds good.

I'll look into linux arm the next days as well 👍 . If things work we can add it to webuis github releases.

@ttytm
Copy link
Member

ttytm commented May 28, 2024

Perhaps we should change #cgo windows to #cgo windows,amd64 so Go builder knows that ARM lib does not exist. @ttytm

#cgo windows,amd64 LDFLAGS: -Lwebui -lwebui-2-static -lws2_32

Its in there since October.

@ttytm ttytm closed this as completed May 28, 2024
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

3 participants