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

compilation errors/warnings #35

Open
mattetti opened this issue Jul 22, 2013 · 4 comments
Open

compilation errors/warnings #35

mattetti opened this issue Jul 22, 2013 · 4 comments

Comments

@mattetti
Copy link

When I cross compile my app using gokogiri, I get the following messages:

compiling for linux-386
# github.com/moovweb/gokogiri/xml
../../../github.com/moovweb/gokogiri/xml/attribute.go:4: undefined: XmlNode
../../../github.com/moovweb/gokogiri/xml/cdata.go:4: undefined: XmlNode
../../../github.com/moovweb/gokogiri/xml/element.go:4: undefined: XmlNode
../../../github.com/moovweb/gokogiri/xml/nodeset.go:6: undefined: Document
../../../github.com/moovweb/gokogiri/xml/nodeset.go:7: undefined: Node
../../../github.com/moovweb/gokogiri/xml/nodeset.go:11: undefined: Document
../../../github.com/moovweb/gokogiri/xml/nodeset.go:16: undefined: Node
../../../github.com/moovweb/gokogiri/xml/nodeset.go:20: undefined: Node
../../../github.com/moovweb/gokogiri/xml/nodeset.go:22: undefined: NewNode
../../../github.com/moovweb/gokogiri/xml/text.go:4: undefined: XmlNode
../../../github.com/moovweb/gokogiri/xml/nodeset.go:22: too many errors
compiling for linux-amd64
# github.com/moovweb/gokogiri/xml
../../../github.com/moovweb/gokogiri/xml/attribute.go:4: undefined: XmlNode
../../../github.com/moovweb/gokogiri/xml/cdata.go:4: undefined: XmlNode
../../../github.com/moovweb/gokogiri/xml/element.go:4: undefined: XmlNode
../../../github.com/moovweb/gokogiri/xml/nodeset.go:6: undefined: Document
../../../github.com/moovweb/gokogiri/xml/nodeset.go:7: undefined: Node
../../../github.com/moovweb/gokogiri/xml/nodeset.go:11: undefined: Document
../../../github.com/moovweb/gokogiri/xml/nodeset.go:16: undefined: Node
../../../github.com/moovweb/gokogiri/xml/nodeset.go:20: undefined: Node
../../../github.com/moovweb/gokogiri/xml/nodeset.go:22: undefined: NewNode
../../../github.com/moovweb/gokogiri/xml/text.go:4: undefined: XmlNode
../../../github.com/moovweb/gokogiri/xml/nodeset.go:22: too many errors

Everything works well for darwin tho.

@mdayaram
Copy link
Contributor

Are you cross compiling in a Darwin machine? The C bindings are dynamically linked libraries that need to exist in your system. Because the libraries are specific to each operating system (libxml in darwin is different than libxml in linux), you can't cross compile gokogiri for multiple platforms in the same machine.

What you'd have to do is get a machine that mimics the target machine you're trying to compile for and compile the code strictly for that there. So if you need linux_i386, linux_amd64, and darwin, then you need three machines, one of each, and you can compile your code on each one individually.

@mattetti
Copy link
Author

That's what I was afraid of :( I guess I will need to setup vagrant. Isn't there a way around where the libraries compiled for each platform are available on my darwin machine and linked at compile time? Seems unlikely but just checking all my options.

@mdayaram
Copy link
Contributor

Hmmm, I haven't really tried it, but I guess it would be possible to point the go compiler to different locations for different libraries when compiling for different OSes, each location containing libraries that have been compiled for those systems.

@mdayaram
Copy link
Contributor

Actually, that would depend on whether the linkers used can link a library that was not compiled for this system, and I doubt the linker in a linux computer knows what the hell to do with a .dylb file from mac =/ I doubt it's possible.

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

2 participants