Results 1 to 8 of 8

Thread: How could use glut library in C++ Builder?

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    Beijing
    Posts
    5

    How could use glut library in C++ Builder?

    where should I locate the dll and header files?
    How what should I do in c++ builder projects?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: How could use glut library in C++ Builder?

    glut can be downloaded from lots of places, you can find them with google pretty easy.

    Just add the library to your project like you would with any other .lib file and make sure you setup the path so it will find your header files, if you don't have documentation for the IDE have a peek around in the project settings, there should be some place where you can setup the path to libraries and includes files to use.

    Mikael

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    Beijing
    Posts
    5

    Re: How could use glut library in C++ Builder?

    Is it right that I copy gult.h to include and copy glut.lib and glut32.lib to lib only?
    If I run the project, the IDE says [Linker Error] 'C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\GLUT32.LIB' contains invalid OMF record, type 0x21 (possibly COFF)

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: How could use glut library in C++ Builder?

    Hi !

    Is it an old C++ builder ? it sounds like it doesn't like the lib file (unless it is corrupted in some way), I am not sure if MS has messed around with the .lib file format in later versions, that's possible.

    You could always locate another website to download glut from and see if it works better with another .lib file (amybe an older one).

    Sorry, I don't know anything about C++builder, anyone that knows anything about this ?

    Mikael

  5. #5
    Member Contributor
    Join Date
    Feb 2000
    Location
    Germany
    Posts
    87

    Re: How could use glut library in C++ Builder?

    Seems like the lib is in the wrong format.
    Use implib.exe (you find it in borland's bin directory) to create a correct one:

    implib glut32.lib glut32.dll

    or similar.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: How could use glut library in C++ Builder?

    Sound like you downloaded the library files for GLUT under MS visual C++.

    You will have to ether download the GLUT librarys for Borland or use a tool which I think is shipped with Borland to convert and VC library to a Borland compatible library.


    Originally posted by linusky:
    Is it right that I copy gult.h to include and copy glut.lib and glut32.lib to lib only?
    If I run the project, the IDE says [Linker Error] 'C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\GLUT32.LIB' contains invalid OMF record, type 0x21 (possibly COFF)

  7. #7
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    Beijing
    Posts
    5

    Re: How could use glut library in C++ Builder?

    And I have used implib to convert the lib files.
    But IDE still reports a error .

    [Linker Error] Unresolved external '_glutSolidSphere' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\OPENGL 640480 PROJECTS FOR GLUT\MAIN.OBJ


    [/B][/QUOTE]

  8. #8
    Member Contributor
    Join Date
    Feb 2000
    Location
    Germany
    Posts
    87

    Re: How could use glut library in C++ Builder?

    Well, I tried it out and it works as expected.
    The error you report can only happen if
    your protoype definition in the glut header
    file is invalid.
    The calling convention must be __stdcall.
    It sounds like yours is cdecl.
    Normally the protoype for glutSolidSphere
    should be

    void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);

    where APIENTRY is defined as __stdcall.
    Hope it helps!

Similar Threads

  1. glaux.h library for C++ Builder
    By Fraktalius in forum OpenGL: Windows
    Replies: 11
    Last Post: 03-31-2009, 08:39 AM
  2. how to use GLUT in c++builder
    By seabridge in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-01-2004, 12:31 PM
  3. How should I use glut library in C++ Builder?
    By linusky in forum OpenGL: Windows
    Replies: 1
    Last Post: 03-29-2004, 06:15 AM
  4. Builder &Glut
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-24-2001, 07:32 AM
  5. glut with Builder C++
    By in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-19-2001, 07:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean