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

ld: warning: ignoring duplicate libraries: '-lobjc' #4502

Open
2 tasks done
prologic opened this issue Jan 2, 2024 · 11 comments
Open
2 tasks done

ld: warning: ignoring duplicate libraries: '-lobjc' #4502

prologic opened this issue Jan 2, 2024 · 11 comments
Labels
unverified A bug that has been reported but not verified

Comments

@prologic
Copy link

prologic commented Jan 2, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Running through the latest Fyne "Hello World" example I noticed this warning during build:

$ go build .
# hello-fyne
ld: warning: ignoring duplicate libraries: '-lobjc'

How to reproduce

  1. Follow the Getting Started guide
  2. Run go build .
  3. Observe the ld warning

Screenshots

Screenshot 2024-01-02 at 11 40 04

Example code

package main

import (
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("Hello World")

	w.SetContent(widget.NewLabel("Hello World!"))
	w.ShowAndRun()
}

Fyne version

2.4.3

Go compiler version

1.21.4

Operating system and version

macOS Ventura 13.6.1

Additional Information

No response

@prologic prologic added the unverified A bug that has been reported but not verified label Jan 2, 2024
@r00tc0d3
Copy link

r00tc0d3 commented Jan 2, 2024

Same here using macOS Sonoma 14.2.1 (23C71) go version go1.21.5 darwin/arm64 using Fyne develop

@andydotxyz
Copy link
Member

This seems to be related to Go 1.21 not Sonoma (as it does not happen with 1.20 or earlier)

@CryoByte33
Copy link

CryoByte33 commented Feb 16, 2024

I am having the same issue on MacOS 14.3.1, Go version 1.22 and Fyne version 2.4.4.

I found this thread and this post that said it's a MacOS Sonoma linker change, and this one that lists it as a possible homebrew issue, but neither the linker flags or reinstalling every brew package on my system was able to get my Fyne project to build.

Edit: I was able to finally build properly using the following:

go run -ldflags="-extldflags=-Wl,-ld_classic,-no_warn_duplicate_libraries,-v" .

It's no longer throwing errors and I was able to start my Fyne project.

@andydotxyz
Copy link
Member

It is just a warning and will not have stopped your project from building (that's partly why it's not been a high priority).
If you had a build error it was something else in the output than this which was the problem.

@skplunkerin
Copy link

Same issue here on my Apple M2 Pro:

MacOS Version:
Sonoma 14.3 (23D56)

Go Version:
go1.21.4 darwin/arm64

Fyne Version:
v2.4.4

@andydotxyz
Copy link
Member

Just confirming - for you too it is just a warning and does not break the compilation or any functionality?

@skplunkerin
Copy link

Just confirming - for you too it is just a warning and does not break the compilation or any functionality?

Correct, just an unnerving warning that doesn't prevent me from using Fyne :)

@CryoByte33
Copy link

It is just a warning and will not have stopped your project from building (that's partly why it's not been a high priority). If you had a build error it was something else in the output than this which was the problem.

I replicated and you were right, it looks unrelated to my previous issue which was caused by another package's update. My bad! The message here persists without the flags posted above, though.

@XinCaoZ
Copy link

XinCaoZ commented Mar 29, 2024

Same issue here on my Apple M3 Pro:

MacOS Version:
Sonoma 14.4 (23E214)

Go Version:
go1.22.1 darwin/arm64

Fyne Version:
v2.4.4

@XinCaoZ
Copy link

XinCaoZ commented Mar 29, 2024

Just confirming - for you too it is just a warning and does not break the compilation or any functionality?

But I hate the error message when I compile the project.😵‍💫

@andydotxyz
Copy link
Member

Agreed, but I think the issue is in the Go compiler, so not sure what we can do.
"-lobjc" is added by the Go compiler not the Fyne source code...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

6 participants