help needed: undefined references to C functions

513 views
Skip to first unread message

Peter Kleiweg

unread,
Apr 5, 2013, 6:14:36 PM4/5/13
to golan...@googlegroups.com

I have this package that wraps the ZeroMQ library, so this uses
cgo. It installs and works OK on several linux machines, but I
got a bug report from someone who has it fail to work. It
installs fine, but when he tries to build a program against the
package, he gets linker errors, all references to C functions in
ZeroMQ are undefined.

The user has giving several listings of Go output and
environment, and I still have no clue of what is going on. I
really need help with this.

I noted that his Go version used a slightly different procedure
for installing the package from what I see on my own machine,
but I do not know what this means.

Please have a look at the issue thread here:

https://github.com/pebbe/zmq3/issues/5


--
Peter Kleiweg
my Go programming cookbook: http://www.let.rug.nl/~kleiweg/go/

Peter Kleiweg

unread,
Apr 5, 2013, 6:29:21 PM4/5/13
to golan...@googlegroups.com
I just installed Go from tip, and I get the same problems as the other person reported.

Kamil Kisiel

unread,
Apr 5, 2013, 6:38:45 PM4/5/13
to golan...@googlegroups.com
On Friday, April 5, 2013 3:29:21 PM UTC-7, Peter Kleiweg wrote:
I just installed Go from tip, and I get the same problems as the other person reported.


Interesting, I've been seeing similar looking errors trying to build llgo against tip in the last few days:

Kamil Kisiel

unread,
Apr 5, 2013, 6:47:01 PM4/5/13
to golan...@googlegroups.com
So I just repeated the process described in that thread with Go 1.0.2 and it built just fine. Seems like a bug in tip. 

Dave Cheney

unread,
Apr 5, 2013, 6:55:57 PM4/5/13
to Kamil Kisiel, golang-nuts
Can you please try to bisect this to a recent revision, it sounds like
you have several reliable test cases.
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Peter Kleiweg

unread,
Apr 5, 2013, 7:08:39 PM4/5/13
to golan...@googlegroups.com
Op zaterdag 6 april 2013 00:29:21 UTC+2 schreef Peter Kleiweg het volgende:

I just installed Go from tip, and I get the same problems as the other person reported.

The problem disappears when I add this -ldflags option:

     go build -ldflags="-linkmode internal" file.go

It also disappears when I remove the pkg-config directive in the package.

Is this a bug in tip? Let this be fixed before Go 1.1. 

Kamil Kisiel

unread,
Apr 5, 2013, 7:24:08 PM4/5/13
to golan...@googlegroups.com
Yep, in the process of doing that now. 

Peter Kleiweg

unread,
Apr 5, 2013, 7:26:21 PM4/5/13
to golan...@googlegroups.com

Ugorji Nwoke

unread,
Apr 6, 2013, 12:20:36 AM4/6/13
to golan...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages