Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Add lib by pragma

Add lib by pragma

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _Flaviu
    wrote on last edited by
    #1

    Why the compiler take

    #pragma comment(lib, "glut32.lib")

    bot not

    #pragma comment(lib, "gl/glut32.lib")

    it get me (on second trial): LINK : fatal error LNK1104: cannot open file "glut32.lib" It is not possible to have libs in other folders than main one ? P.S. Of course that I have glut32.lib file on the right path, the problem become that is not recognize gl\glut32.lib path (however glut32.lib is there) !

    D 1 Reply Last reply
    0
    • _ _Flaviu

      Why the compiler take

      #pragma comment(lib, "glut32.lib")

      bot not

      #pragma comment(lib, "gl/glut32.lib")

      it get me (on second trial): LINK : fatal error LNK1104: cannot open file "glut32.lib" It is not possible to have libs in other folders than main one ? P.S. Of course that I have glut32.lib file on the right path, the problem become that is not recognize gl\glut32.lib path (however glut32.lib is there) !

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      You are using a relative path vs. an absolute path. A better approach is to just use "glut32.lib" in the #pragma statement, and have the linker configured to search the proper directory for the .lib file with the Additional Library Directories setting.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      _ 1 Reply Last reply
      0
      • D David Crow

        You are using a relative path vs. an absolute path. A better approach is to just use "glut32.lib" in the #pragma statement, and have the linker configured to search the proper directory for the .lib file with the Additional Library Directories setting.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        _ Offline
        _ Offline
        _Flaviu
        wrote on last edited by
        #3

        Yes, had worked. Thanks !

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups