Thursday, March 25, 2021

How do I build an import library (.lib) AND a DLL in Visual C++?

How do I build an import library (.lib) AND a DLL in Visual C++?

  1. How do I build an import library (.lib) AND a DLL in Visual C++?
  2. A Question:I want to have a single Visual Studio project that builds a DLL file and an import library (.lib) file. (An import library is a statically-linked library that takes care of loading that DLL file in other projects that use it).

    So I went to Visual Studio C++ 2008 Express Edition, created a New Project of type Class Library, and set the "Configuration Type" to be "Dyanamic Library (.dll)".

    But when I build the solution, the only relevant output file I see is a DLL file; I don't see any LIB file getting generated. I looked in the project directory and all subdirectories (Release and Debug).

    Caveat: I just had this exact problem where my .lib file was not being generated. After googling through all info I could find about possible causes and carefully going through all the answers below I finally figured out that it was because my .cpp file didn't include my .h file. :( Just throwing it out here so that my comment could (with a small probability) help someone/myself if my stupid mistake is repeated in some distant future

  3. This is a paragraph.

  4. This is a paragraph.

  5. This is a paragraph.

  6. This is a paragraph.

  7. This is a paragraph.

  8. This is a paragraph.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

No comments:

Post a Comment