Setting up Opengl for Borlandc++

五迷三道 提交于 2019-11-30 10:00:36

问题


I have copied the glut.h file in c:/turbo/tc/include/ directory and glut32.dll in c:/windows/System32/.

After this what should I do ?


回答1:


your path implies old Borland Turbo C++ 3.1 to me

  • which was the old MS-DOS C++ IDE (similar to Borland TP 7.0 pascal IDE)
  • in which you can not have classic 32bit OpenGL
  • there were some 16bit MS-DOS versions of GL+GLUT compatible ports of glut+gl libs.
  • so unless you do not have them then it will not work no matter you do
  • if you do then read the provided readme.txt or whatever to see how to use it
  • there were some tutorials on them but I strongly doubt you will find them on the internet
  • because most of old programing portals is off-line and stuff lost forever ...

if you have newer compiler like Borland C++ BCC 5.0 or newer

  • then just include headers
  • link lib files for used dll's for example:

    #include "my_GL_headers\\glut.h"
    #pragma link "my_GL_headers\\glut.lib"
    
  • use implib tool if you do not have them or are incompatible

  • because most provided libs are for MSVC++
  • which are incompatible with standard Intel object format
  • for more info see difference between COMF and OMF
  • some header files already link their lib files so do this only if you have unresolved externals ...

If you use IDE like Borland C++ builder 1,2,3,4,5,6 or Developer Studio 2006 Turbo C++

  • then look at this answer of mine: How to render an openGL frame in C++ builder?
  • all the headers and libs are included in IDE ...

PS this is how mine usual GL includes look like in BDS2006 projects

#include <windows.h>
#include <jpeg.hpp>
#include <math.h>
#define GLEW_STATIC
#include "gl\glew.c"
#include "gl\gl.h"
#include "gl\glu.h"
#include "gl\glext.h"
#include "gl\wglext.h"   
#include "gl\glut.h"
  • where gl is project source local folder
  • including all headers/objs/libs ...
  • the only lib you need is glut.lib (if you want to use glut)
  • GLEW can be either as lib/dll/obj or as C++ source code
  • I prefer the C++ source version under borland/embarcadero


来源:https://stackoverflow.com/questions/26146116/setting-up-opengl-for-borlandc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!