第一次使用perl OpenGL

时间:2014-07-28 05:45:32

标签: perl

很棒的程序员....我正在尝试学习perl opengl ...我安装了所有的模块,它一切顺利..一切都很好!除此之外...... 我的第一个代码是

use OpenGL;
use SDL;

glpOpenWindow();

print "Return to exit\n";

while(<>){
exit;
}

结果是 在C:/strawberry/perl/site/lib/OpenGL.pm第6110行转到未定义的子程序&AutoLoader :: AUTOLOAD。

我尝试了OpenGL的test.pl。非常好用,但这行我很奇怪!

1 个答案:

答案 0 :(得分:0)

以下是来自OpenGL.pm

的方法AUTOLOAD的源代码
sub AUTOLOAD {
    # This AUTOLOAD is used to 'autoload' constants from the constant()
    # XS function.  If a constant is not found then control is passed
    # to the AUTOLOAD in AutoLoader.

    # NOTE: THIS AUTOLOAD FUNCTION IS FLAWED (but is the best we can do for now).
    # Avoid old-style ``&CONST'' usage. Either remove the ``&'' or add ``()''.
    if (@_ > 0) {

        # Is it an old OpenGL-0.4 function? If so, remap it to newer variant
    local($constname);
    ($constname = $AUTOLOAD) =~ s/.*:://;
    if (grep ($_ eq $constname, @rename_old)) {
        eval "sub $AUTOLOAD { $AUTOLOAD" . "_s(\@_) }";
        goto &$AUTOLOAD;
    }

        $AutoLoader::AUTOLOAD = $AUTOLOAD;
        goto &AutoLoader::AUTOLOAD; #LINE 6110
    }

他们发表评论THIS AUTOLOAD FUNCTION IS FLAWED因此,您所获得的警告可能不是由于您的程序,而是模块本身的问题。