Closed fastpars closed 12 years ago
I am guessing this would similar to issue #1.
Considering the lib works for everyone else (at least as far as I know), I can only guess that there is a problem with the linker finding the lib on your system. I had a similar issue at some point. This was because libglfw installed itself to /usr/local/lib
on my system. Which is not a place the linker would look by itself. The 'solution' at the time was to set the LD_LIBRARY_PATH
env var to include /usr/local/lib
. The proper solution would obviously be to reinstall libglfw and explicitly give it the correct install path.
I am unsure if this will resolve anything for you though.
I am also having the same problem on OSX (mind you, I'm fairly new to Go here). I have installed GLFW, including the dynamic library (dylib) but still getting these errors when I try to go run testdata/simplewindow/main.go
Not sure if this helps at all...
$ export DYLD_PRINT_LIBRARIES=1
$ go run testdata/simplewindow/main.go
dyld: loaded: /usr/local/go/bin/go
dyld: loaded: /usr/lib/libSystem.B.dylib
dyld: loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
dyld: loaded: /System/Library/Frameworks/Security.framework/Versions/A/Security
dyld: loaded: /usr/lib/system/libmathCommon.A.dylib
dyld: loaded: /usr/lib/libauto.dylib
dyld: loaded: /usr/lib/libicucore.A.dylib
dyld: loaded: /usr/lib/libobjc.A.dylib
dyld: loaded: /usr/lib/libz.1.dylib
dyld: loaded: /usr/lib/libstdc++.6.dylib
dyld: loaded: /usr/lib/libsqlite3.dylib
# command-line-arguments
dyld: loaded: /usr/local/go/pkg/tool/darwin_amd64/6g
dyld: loaded: /usr/lib/libSystem.B.dylib
dyld: loaded: /usr/lib/system/libmathCommon.A.dylib
# command-line-arguments
dyld: loaded: /usr/local/go/pkg/tool/darwin_amd64/pack
dyld: loaded: /usr/lib/libSystem.B.dylib
dyld: loaded: /usr/lib/system/libmathCommon.A.dylib
# command-line-arguments
dyld: loaded: /usr/local/go/pkg/tool/darwin_amd64/6l
dyld: loaded: /usr/lib/libSystem.B.dylib
dyld: loaded: /usr/lib/system/libmathCommon.A.dylib
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwExtensionSupported: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwSetTime: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwGetKey: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwGetNumberOfProcessors: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwGetTime: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwGetDesktopMode: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwTerminate: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwSetWindowSize: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwEnable: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwSleep: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwOpenWindowHint: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwCloseWindow: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwGetWindowParam: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwDisable: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwGetWindowSize: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwSetWindowPos: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwWaitEvents: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwIconifyWindow: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwGetMouseWheel: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwSwapBuffers: not defined
/usr/local/go/pkg/darwin_amd64/github.com/jteeuwen/glfw.a(glfw.cgo2.o)(__TEXT/__text): glfwInit: not defined
too many errors
I think this basically proves that the dynamic library at /usr/local/lib/libglfw.dylib is not being linked.
I updated go1 to go1.0.1 and this bug gone =)
That's good to hear. Hope this applies to everyone having linking issues.
Unfortunately not me - I downloaded go1.0.1 and this is what I encountered :-/
Hi codedread, you can try applying the 3 patch-sets mentioned in msg #2 of this thread: http://groups.google.com/group/golang-nuts/browse_thread/thread/b98c3677ec716379 -- didn't resolve my Windows-specific troubles but did get rid of the "not defined" errors during linking.
metaleap: I was able to git apply the first 2 patches, but had to do the third one (5822049) manually.
After doing this, I went to src/pkg/github.com/jteeuwen/glfw/testdata/simplewindow and typed
go run main.go
and got a tiny black window! No linker errors. Thank you! :D
Here all got applied automatically with "git apply"s white-space-ignore-nowarn-or-some-such flags :) glad stuff worked out for you.
Good to see this is resolved for +fastpars.
+codedread, if you still have problems on OSX, could you open a separate issue for that? I suspect the problem there is a different one. It will also help me keep things a little organized here.
My interpretation is that @codedread had fixed the issue. I'm closing this. If anyone encounters a problem please re-open or create a new issue.
I'm currently on version go1.0.3 on Mac OS X and am having the same issues. Setting LD_LIBRARY_PATH or DYLD_LIBRARY_PATH to /usr/local/lib (where GLFW libraries are installed) doesn't help. Anyone else having these issues?
@ChuckAditazz, I was having the same problem until I rebuilt the GLFW dylib with a different architecture.
Try adding the flag -m64
to CFLAGS in glfw-2.7.8/lib/cocoa/Makefile.cocoa
before a make cocoa-clean
and a sudo make cocoa-dist-install
up at its root directory.
Hi. I have trouble with glfw.a. Maybe it's the same bug like https://github.com/jteeuwen/glfw/issues/1 then sorry. How i can fix it?
Go1
Linux 3.0.0-17-generic #30-Ubuntu x86_64 GNU/Linux
glfw-2.7.5