Menu

Any static library replaces glut32.dll

J C
2010-04-29
2012-09-26
  • J C

    J C - 2010-04-29

    Under OpenGL programming at Code::Blocks, all complied executeable file would
    run only with the dynamic library glut32.dll in the same folder. It's quite
    inconvenience to get the file work only together with glut32.dll. I did try to
    use freeglut_static.lib and take away glut32.dll, but doesn't work. Should
    there be any static library that can be used for compliation without the need
    of glut32.dll, so that the executeable file can work alone? Tks.

     
  • cpns

    cpns - 2010-04-29

    That has nothing to do with Code::Blocks and everything to do with how the
    operating system locates DLL's. This is how it works:
    http://msdn.microsoft.com/en-
    us/library/7d83bc18%28VS.71%29.aspx
    .

    If you are using a static library it must be built specifically for the
    compiler you are using. In the case of Dev-C++, this is usually MinGW/GCC (and
    the same for Code::Blocks). By convention GNU static libraries use the naming
    convention libXXX.a rather than XXX.lib, so the library you used may not be a
    MinGW/GCC compatible library.

     
  • J C

    J C - 2010-04-30

    Hi, cpns,

    Thanks for your input. Understand that Code::Blocks is not the source of the
    issue. Yes, my complier is GNU/GCC Compiler. And I did replace all libraries
    with "libopengl.a, libgcc.a, libgcc_s.a, libglaux.a, libglu32.a, libglut.a,
    libglut32.a", but it still ask for the missing of glut32.dll. Do you have any
    idea, what I missed? By the way, the header "glut.h" included would call for
    glut32.dll directly, wouldn't it?

    Tks.

     
  • cpns

    cpns - 2010-04-30

    And I did replace all libraries with "libopengl.a, libgcc.a, libgcc_s.a,
    libglaux.a, libglu32.a, libglut.a, libglut32.a"

    Replace then with what? Why? Those are export libraries; you need them to
    access the DLL at runtime, unless you use LoadLibrary()/GetProcAddress(). The
    code will not link without them. See in the "PLEASE READ BEFORE POSTING A
    QUESTION
    " thread where it says to post the build
    log? That is what you should do rather than vaguely 'describe' what you did,
    since the compile log will show exactly what you did without ambiguity or
    omission.

    While you are in that thread, you may note the "Getting started with..."
    section has "Getting started with OpenGL/GLUT " as item number 1.

    but it still ask for the missing of glut32.dll.

    When does it do that? DLLs are sought at runtime by the OS, not at build
    time by the linker.

    By the way, the header "glut.h" included would call for glut32.dll directly,
    wouldn't it?

    Headers don't 'call' anything; what does that mean? They declared symbols
    (such as functions), which are then resolved by the linker either through an
    export library (if using a DLL) or through a static library if not. Then at
    runtime, if there is reference to any DLLs thay are loaded and linked by the
    OS.

    Either way, regardless of where the DLL is located, you would have to deploy
    it with your application and the easiest way of ensuring the right version,
    and not overwriting an existing version is to place it with the executable.
    That is why applications have installers.

     
  • J C

    J C - 2010-05-01

    Partly understand, however my aim is to create OpenGL executable file that can
    be run alone (ie without teh implementation of glut32.dll) . Hope you
    understand my point of view. Tks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.