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

Link error for glVertexAttribDivisor on OS X 10.7.5 #35

Closed
lalcmellkmal opened this issue May 11, 2013 · 6 comments
Closed

Link error for glVertexAttribDivisor on OS X 10.7.5 #35

lalcmellkmal opened this issue May 11, 2013 · 6 comments

Comments

@lalcmellkmal
Copy link

@lalcmellkmal lalcmellkmal commented May 11, 2013

It seems to be from ES 3.0? Anyway, I just commented it out locally for now.

note: Undefined symbols for architecture x86_64:
  "_glVertexAttribDivisor", referenced from:
      _glVertexAttribDivisor__c_stack_shim in librustopengles.o
@neuralvis
Copy link

@neuralvis neuralvis commented May 13, 2013

+1. I am getting the same error on OS X 10.8.2.

rustc  opengles.rc -o librustopengles.dummy
error: linking with `cc` failed with code 1
note: cc arguments: -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -m64 -o libopengles-94839cbfe144198-0.1.dylib librustopengles.o -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -lcore-c3ca5d77d81b46c1-0.6 -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -lstd-4782a756585a81-0.6 -framework OpenGL -dynamiclib -Wl,-install_name,@rpath/libopengles-94839cbfe144198-0.1.dylib -Wl,-no_compact_unwind -lmorestack -lrustrt -Wl,-rpath,@executable_path/../../../../../usr/local/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,/usr/local/Cellar/rust/0.6/lib/rustc/x86_64-apple-darwin/lib
note: Undefined symbols for architecture x86_64:
  "_glVertexAttribDivisor", referenced from:
      _glVertexAttribDivisor__c_stack_shim in librustopengles.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
make: *** [librustopengles.dummy] Error 101

@metajack
Copy link
Contributor

@metajack metajack commented May 14, 2013

Something like this might be needed: #37

@ehsanul
Copy link
Contributor

@ehsanul ehsanul commented May 15, 2013

@metajack I tried that out here: ehsanul@3c2e1b1

Clearly I don't know what I'm doing, I still got the same error:

~/rust/rust-opengles lion-fail:) make clean && ./configure && make
rm -f *.o *.a *.so *.dylib *.dll *.dummy *-test
rustc  --cfg mac_10_7 opengles.rc -o librustopengles.dummy
error: linking with `cc` failed with code 1
note: cc arguments: -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -m64 -o libopengles-94839cbfe144198-0.1.dylib librustopengles.o -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -lcore-c3ca5d77d81b46c1-0.6 -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -lstd-4782a756585a81-0.6 -framework OpenGL -dynamiclib -Wl,-install_name,@rpath/libopengles-94839cbfe144198-0.1.dylib -Wl,-no_compact_unwind -lmorestack -lrustrt -Wl,-rpath,@executable_path/../../../../usr/local/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,/usr/local/Cellar/rust/0.6/lib/rustc/x86_64-apple-darwin/lib
note: Undefined symbols for architecture x86_64:
    "_glVertexAttribDivisor", referenced from:
            _glVertexAttribDivisor__c_stack_shim in librustopengles.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
make: *** [librustopengles.dummy] Error 101

I'm on OS X 10.7.5.

@ehsanul
Copy link
Contributor

@ehsanul ehsanul commented May 15, 2013

Ok, looks like I just had a misunderstanding of how document attributes work in rust. Quoting: "If any match is found the item is compiled; if no match is found the item is parsed but not compiled."

So when I got rid of the #[cfg(not(mac_10_6))], but kept #[cfg(not(mac_10_7))] from my commit, it compiled successfully for me on 10.7.

I couldn't figure out a way to handle both 10.6 and 10.7 with the conditional attribute system. Something like:

#[cfg(not(mac_10_6 || mac_10_7))]

Or

#[cfg(not(mac_10_6) and not(mac_10_7))]
@ehsanul
Copy link
Contributor

@ehsanul ehsanul commented May 15, 2013

Ok, I just guessed the syntax a couple of times, and you guys support it obviously :). Fixed here: #38

@metajack
Copy link
Contributor

@metajack metajack commented May 16, 2013

Your pull request has landed. Closing this.

@metajack metajack closed this May 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.