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

Cannot build #16

Open
mlb5000 opened this issue May 17, 2016 · 8 comments
Open

Cannot build #16

mlb5000 opened this issue May 17, 2016 · 8 comments

Comments

@mlb5000
Copy link

mlb5000 commented May 17, 2016

I am running libgtk 3.12 in Ubuntu 14.04 and get the following when I do go get -tags gtk_3_12 github.com/sourcegraph/webloop/...

# github.com/sourcegraph/webloop/examples/angular-static-seo
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-587755410/000009.o: In function `removeClosure':
/tmp/go-build135241220/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:10: multiple definition of `removeClosure'
/tmp/go-link-587755410/000001.o:/tmp/go-build135241220/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:10: first defined here
/tmp/go-link-587755410/000009.o: In function `goMarshal':
/tmp/go-build135241220/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:23: multiple definition of `goMarshal'
/tmp/go-link-587755410/000001.o:/tmp/go-build135241220/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:23: first defined here
collect2: error: ld returned 1 exit status

# github.com/sourcegraph/webloop/cmd/static-reverse-proxy
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-852559976/000009.o: In function `removeClosure':
/tmp/go-build135241220/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:10: multiple definition of `removeClosure'
/tmp/go-link-852559976/000001.o:/tmp/go-build135241220/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:10: first defined here
/tmp/go-link-852559976/000009.o: In function `goMarshal':
/tmp/go-build135241220/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:23: multiple definition of `goMarshal'
/tmp/go-link-852559976/000001.o:/tmp/go-build135241220/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:23: first defined here
collect2: error: ld returned 1 exit status
@mlb5000
Copy link
Author

mlb5000 commented May 17, 2016

And if I just run go get github.com/sourcegraph/webloop/... I get

# github.com/gotk3/gotk3/gtk
could not determine kind of name for C.gtk_application_get_actions_for_accel
could not determine kind of name for C.gtk_application_get_menu_by_id
could not determine kind of name for C.gtk_application_prefers_app_menu

Do you have a recommended Linux configuration for this?

@alexandervantrijffel
Copy link

alexandervantrijffel commented Jun 24, 2016

Same issue here on Ubuntu 15.10, I receive the gcc errors when I run go get github.com/sourcegraph/webloop/...

@paultag
Copy link

paultag commented Oct 3, 2016

This will be fixed if sourcegraph/go-webkit2#32 gets merged

@mikluko
Copy link

mikluko commented Dec 19, 2016

sourcegraph/go-webkit2#32 is merged by now and I'm able to successfully build go-webkit2. But building webloop throws same error:

$ go install -tags gtk_3_14 github.com/sourcegraph/webloop/...
# github.com/sourcegraph/webloop/cmd/static-reverse-proxy
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-934973757/000009.o: In function `removeClosure':
/tmp/go-build/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:18: multiple definition of `removeClosure'
/tmp/go-link-934973757/000001.o:/tmp/go-build/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:18: first defined here
/tmp/go-link-934973757/000009.o: In function `goMarshal':
/tmp/go-build/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:35: multiple definition of `goMarshal'
/tmp/go-link-934973757/000001.o:/tmp/go-build/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:35: first defined here
collect2: error: ld returned 1 exit status

# github.com/sourcegraph/webloop/examples/angular-static-seo
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-099896313/000009.o: In function `removeClosure':
/tmp/go-build/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:18: multiple definition of `removeClosure'
/tmp/go-link-099896313/000001.o:/tmp/go-build/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:18: first defined here
/tmp/go-link-099896313/000009.o: In function `goMarshal':
/tmp/go-build/github.com/gotk3/gotk3/glib/_obj/_cgo_export.c:35: multiple definition of `goMarshal'
/tmp/go-link-099896313/000001.o:/tmp/go-build/github.com/conformal/gotk3/glib/_obj/_cgo_export.c:35: first defined here
collect2: error: ld returned 1 exit status

Running Debian 8.6 (Wheezy)

@mikluko
Copy link

mikluko commented Dec 19, 2016

Probably related to upstream: gotk3/gotk3#116

@mikluko
Copy link

mikluko commented Dec 19, 2016

I found that old gotk3 path is used in webloop while newer one is used in go-webkit2. So two copies of gotk3 were built causing this 'multiple definition' error. Build passes successfully once import path is fixed.

diff --git a/example_test.go b/example_test.go
index e93d5c1..20e2e8a 100644
--- a/example_test.go
+++ b/example_test.go
@@ -5,7 +5,7 @@ import (
        "os"
        "runtime"

-       "github.com/conformal/gotk3/gtk"
+       "github.com/gotk3/gotk3/gtk"
        "github.com/sourcegraph/webloop"
 )

diff --git a/static_renderer.go b/static_renderer.go
index 3ecb797..720c86c 100644
--- a/static_renderer.go
+++ b/static_renderer.go
@@ -8,7 +8,7 @@ import (
        "sync"
        "time"

-       "github.com/conformal/gotk3/gtk"
+       "github.com/gotk3/gotk3/gtk"
 )

 // StaticRenderer generates and returns static HTML based on a snapshot of a Web
diff --git a/webloop.go b/webloop.go
index a326681..4a65fdf 100644
--- a/webloop.go
+++ b/webloop.go
@@ -3,7 +3,7 @@ package webloop
 import (
        "errors"

-       "github.com/conformal/gotk3/glib"
+       "github.com/gotk3/gotk3/glib"
        "github.com/sourcegraph/go-webkit2/webkit2"
        "github.com/sqs/gojs"
 )
diff --git a/webloop_test.go b/webloop_test.go
index 4646897..a8100a1 100644
--- a/webloop_test.go
+++ b/webloop_test.go
@@ -7,7 +7,7 @@ import (
        "runtime"
        "testing"

-       "github.com/conformal/gotk3/gtk"
+       "github.com/gotk3/gotk3/gtk"
 )

 func init() {

@xeoncross
Copy link

Note, OSX needs both of these packages

brew install gtk+ gtk+3

And the missing-from-brew javascriptcoregtk as well:

# pkg-config --cflags javascriptcoregtk-3.0
Package javascriptcoregtk-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `javascriptcoregtk-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'javascriptcoregtk-3.0' found
pkg-config: exit status 1

@ghost
Copy link

ghost commented Dec 31, 2016

Thanks @akabos and @canuckfan772
Finally got it working. I had to apt-get install libwebkit2gtk-4.0-dev instead of libwebkit2gtk-3.0-dev. Fixed import paths. And finally was able to build using tags as suggested in gotk3/gotk3#152.

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

5 participants