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. How to create and use a lib file ?

How to create and use a lib file ?

Scheduled Pinned Locked Moved C / C++ / MFC
c++debugginghelptutorialquestion
5 Posts 5 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.
  • K Offline
    K Offline
    KEL3
    wrote on last edited by
    #1

    Hello there, I am trying to put my code into a ".lib" file but there is sth going wrong. I use MSVC++6 (I also use MSVC++2005 if you prefer). I create a "Static library project", I place my class files into, the project, I compile (debug and release) and I get the two .lib files. Then I create the 2nd project (let's say a dialog project) and I add the ".h" file and the ."lib" into my project. I place the pragma comment(lib, "MyLib.lib" ) // If I remember it clearly. into the file that uses the library code (or it's header) and then I try to build (debug or release)... but then I get linker errors... One of them is for : _afx(sth_here)Nil // I don't know what this function is ! Any help would be appreciated.

    kostas KEL

    C R 2 Replies Last reply
    0
    • K KEL3

      Hello there, I am trying to put my code into a ".lib" file but there is sth going wrong. I use MSVC++6 (I also use MSVC++2005 if you prefer). I create a "Static library project", I place my class files into, the project, I compile (debug and release) and I get the two .lib files. Then I create the 2nd project (let's say a dialog project) and I add the ".h" file and the ."lib" into my project. I place the pragma comment(lib, "MyLib.lib" ) // If I remember it clearly. into the file that uses the library code (or it's header) and then I try to build (debug or release)... but then I get linker errors... One of them is for : _afx(sth_here)Nil // I don't know what this function is ! Any help would be appreciated.

      kostas KEL

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Can you post the exact error messages ?


      Cédric Moonen Software developer
      Charting control [v1.1]

      R 1 Reply Last reply
      0
      • C Cedric Moonen

        Can you post the exact error messages ?


        Cédric Moonen Software developer
        Charting control [v1.1]

        R Offline
        R Offline
        rgbalpha
        wrote on last edited by
        #3

        Do you try adding your .lib to the project settings? or Is it your .lib path incorrect?

        H 1 Reply Last reply
        0
        • R rgbalpha

          Do you try adding your .lib to the project settings? or Is it your .lib path incorrect?

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          You can answer directly to sender


          WhiteSky


          1 Reply Last reply
          0
          • K KEL3

            Hello there, I am trying to put my code into a ".lib" file but there is sth going wrong. I use MSVC++6 (I also use MSVC++2005 if you prefer). I create a "Static library project", I place my class files into, the project, I compile (debug and release) and I get the two .lib files. Then I create the 2nd project (let's say a dialog project) and I add the ".h" file and the ."lib" into my project. I place the pragma comment(lib, "MyLib.lib" ) // If I remember it clearly. into the file that uses the library code (or it's header) and then I try to build (debug or release)... but then I get linker errors... One of them is for : _afx(sth_here)Nil // I don't know what this function is ! Any help would be appreciated.

            kostas KEL

            R Offline
            R Offline
            Rems Kris
            wrote on last edited by
            #5

            Include the library in your project settings and specify its path in Additional lib path.

            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