Results 1 to 3 of 3

Thread: Making .libs!

  1. #1
    Junior Member
    Join Date
    Jun 2006
    Posts
    6

    Making .libs!

    I have a class that uses a DLL. I was wondering if I could compile the class into a .lib. I would just use it like it is but it requires me shutting of some of the options in MSVC++8.

    Does anyone know how I could turn my .cpp into a .lib?

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Posts
    106
    I'm learning C++, so this may not be the "most proper" implementation, but I think it should work:

    Code:
    extern "C" __declspec(dllexport)
    /*your class here */
    
    extern "C" __declspec(dllexport)
    /* your methods here */
    That is, of course, for dynamic linked libraries, you should be able to use lib.exe to convert the necessary code to a static library

    Additionally, MSDN has some stuff on it too.

    Good luck!
    "The Texan turned out to be good-natured, generous and likeable. In three days no one could stand him." Catch 22 by Joseph Heller.

    Buddies? I have no buddies...


    Give the BSD daemon some love (proud FreeBSD user)

  3. #3
    Junior Member
    Join Date
    Jun 2006
    Posts
    6
    Thank you!

    Update:: That MSDN link did the trick!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •