无法在Windows 64位上安装Dev-c ++的过剩

时间:2014-09-04 06:50:13

标签: c++ opengl glut

我想为Dev-c ++安装glut库,我执行以下操作:

  • here下载并安装Dev-c ++,(Dev-Cpp 5.7.1 TDM-GCC x64 4.8.1 Setup.exe)
  • 添加过剩:工具 - >检查 套餐...... - >从Devpak网站安装过剩3.7.6

    (基本工作目录:C:\ Program Files(x86)\ Dev-Cpp)
  • glut.h, glutf90.hinclude\GL复制到MinGW64\include\GL
    MinGW64\x86_64-w64-mingw32\include\GL(我不知道正确的文件夹在哪里,所以我添加到其他地方...)
  • libglut32.alib\复制到MinGW64\lib(来自youtube here的参考)
  • 打开Dev-c ++和 创建一个空的C ++项目,将这些选项添加到项目链接器参数:
    -lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32
  • 添加一些文件,如下所示:

// Lab01_Perimitives.cpp

/* -- INCLUDE FILES ------------------------------------------------------ */
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glut.h>


/* ----------------------------------------------------------------------- */


void myInit( void )  {
  glClearColor( 0.0, 0.0, 0.0, 0.0 );
  glColor3f( 1.0, 0.0, 1.0 );
  glPointSize( 3.0 );
  glMatrixMode( GL_PROJECTION );
  glLoadIdentity( );
  glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}

/* ----------------------------------------------------------------------- */

/* ----------------------------------------------------------------------- */
void myDisplay( void )  {
        glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); 

        glBegin(GL_POLYGON);
            glColor3f(1.0f,0.0f,0.0f);      
            glVertex3f(0.25, 0.25, 0.0);
            glColor3f(0.0f,1.0f,0.0f);          
            glVertex3f(0.75, 0.25, 0.0);
            glColor3f(0.5f,0.5f,1.0f);              
            glVertex3f(0.75, 0.75, 0.0);
            glColor3f(0.0f,0.0f,1.0f);          
            glVertex3f(0.25, 0.75, 0.0);

        glEnd();

        glutSwapBuffers();

}

/* ----------------------------------------------------------------------- */

int main( int argc, char *argv[] )  {
  // Initialize GLUT.
  glutInit( &argc, argv );
  // Set the mode to draw in.
  glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB );
  // Set the window size in screen pixels.
  glutInitWindowSize( 640, 480 );
  // Set the window position in screen pixels.
  glutInitWindowPosition( 100, 150 );
  // Create the window.
  glutCreateWindow( "Lab01" );
  // Set the callback funcion to call when we need to draw something.


  myInit( );
  glutDisplayFunc( myDisplay );
  // Initialize some things.
  // Now that we have set everything up, loop responding to events.
  glutMainLoop( );
}

/* ----------------------------------------------------------------------- */

但是当我编译时,我得到了这些错误:

c:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe    skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/libglut32.a when searching for -lglut32
c:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe    skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../lib/libglut32.a when searching for -lglut32
...etc...
c:\program files (x86)\dev-cpp\mingw64\x86_64-w64-mingw32\bin\ld.exe    cannot find -lglut32
E:\Mon hoc\Do hoa may tinh\Lab01\collect2.exe   [Error] ld returned 1 exit status
E:\Mon hoc\Do hoa may tinh\Lab01\Makefile.win   recipe for target 'Lab01.exe' failed

这里有什么问题,如何解决? 我的电脑运行Windows 8.1 64位

0 个答案:

没有答案