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

undefined subroutine &AutoLoader::AUTOLOAD #2

Closed
devel-chm opened this issue Feb 27, 2017 · 10 comments
Closed

undefined subroutine &AutoLoader::AUTOLOAD #2

devel-chm opened this issue Feb 27, 2017 · 10 comments

Comments

@devel-chm
Copy link
Collaborator

The current git of OpenGL::GLUT now builds and passes tests which closes issue #1. However, when I try to run the example program, I get the following error:

perl -Mblib menutest.pl
Goto undefined subroutine &AutoLoader::AUTOLOAD at /cygdrive/e/chm/pogl/pogl-split/GLUT/OpenGL-GLUT/blib/lib/OpenGL/GLUT.pm line 435.

@wchristian
Copy link
Collaborator

You never actually use Autoloader in GLUT.pm.

@devel-chm
Copy link
Collaborator Author

I tried a number of combinations with no luck. The issue #2 is just opened on the vanilla result of the fix from issue #1. Fixes welcome!

@devel-chm
Copy link
Collaborator Author

When I add 'use AutoLoader;' at the top, the error becomes:

perl -Mblib menutest.pl
Can't locate auto/OpenGL/GLUT/constant.al in @inc (@inc contains: /cygdrive/c/Perl/git/OpenGL-GLUT/blib/arch /cygdrive/c/Perl/git/OpenGL-GLUT/blib/lib /cygdrive/c/Perl/local64/lib/perl5/cygwin-thread-multi /cygdrive/c/Perl/local64/lib/perl5 /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.22 /usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.22 /usr/lib/perl5/5.22/x86_64-cygwin-threads /usr/lib/perl5/5.22 .) at menutest.pl line 4.

I had a thought the problem might be the namespace for the XS constant routine but I don't know enough about AutoLoader to debug further. Probably won't have significant time until next weekend but would really like to get OpenGL::GLUT released.

If you use OpenGL for GLUT/FreeGLUT, I would appreciate help with fix and confirming that it works ok.

@wchristian
Copy link
Collaborator

I can't really provide a fix since i'm not sure what the code is supposed to be doing. Adding Devel::Confess results in this stacktrace:

d:\cpan\OpenGL-GLUT>prove -b menutest.pl
menutest.pl .. Can't locate auto/OpenGL/GLUT/constant.al in @INC (@INC contains: D:\cpan\OpenGL-GLUT\blib\lib D:\cpan\OpenGL-GLUT\blib\arch C:/strawberry/perl/site/lib/MSWin32-x86-multi-thread-64int C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib .) at C:/strawberry/perl/lib/AutoLoader.pm line 54.
        AutoLoader::autoload_sub("OpenGL::GLUT::constant") called at C:/strawberry/perl/lib/AutoLoader.pm line 23
        AutoLoader::AUTOLOAD("glutInit", 0) called at D:\cpan\OpenGL-GLUT\blib\lib/OpenGL/GLUT.pm line 440
        OpenGL::GLUT::AUTOLOAD() called at menutest.pl line 5
menutest.pl .. Dubious, test returned 255 (wstat 65280, 0xff00)

You maybe want to remove this altogether: https://github.com/devel-chm/OpenGL-GLUT/blob/master/lib/OpenGL/GLUT.pm#L427-L436

@wchristian
Copy link
Collaborator

Also looking at Sysiphus' commit, it doesn't look like much of a fix. His patch just disabled the XS parts entirely, but i'm sure you still want XS functions to be loaded?

@devel-chm
Copy link
Collaborator Author

I found the problem. Calling XS loading twice for the same module.

@devel-chm
Copy link
Collaborator Author

Fix looks good. Let me know if you can use OpenGL::GLUT in place of OpenGL qw(:glutfunctions :glutconstants);

@wchristian
Copy link
Collaborator

Haven't tried that yet, but i can confirm menutest.pl works here too.

I'll do some work on another task first (reintegrating the old git history without performing a force push), then i'll try and make test.pl work with this module.

@wchristian
Copy link
Collaborator

Works fine in Perl-GPU/OpenGL-Modern#41

@devel-chm
Copy link
Collaborator Author

Great! Maybe we should put the functions used in test.pl at the top of the OpenGL::Modern priority list so we can finish this update.

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