Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Succeeded, but no .lib file gets created

I inherited a substantial amount of code, including a visual studio project that is supposed to (as best as I can tell) build a .lib file. Visual studio says "... Generating Code... Creating Library... Creating browse information file...", and at the end, it says the build succeeded. In the release/debug folder, it has a bunch of .obj files, but it doesn't have a .lib file. What could I be missing?

Thanks!

like image 766
Jim Avatar asked Oct 16 '10 19:10

Jim


People also ask

How do I create a .LIB file in Visual Studio?

To create a static library project in Visual StudioOn the menu bar, choose File > New > Project to open the Create a New Project dialog. At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Library.

How do I view a .LIB file?

To load the LIB file, select File → Load Library..., navigate to the location of your LIB file, select the file, and click Open.

What is a .LIB file?

A lib file is just a collection of related obj files, much like putting obj files in a directory. That is essentially what a lib file is, a library of obj files. For a static link, all of the obj files that an executable uses are combined into one file.


1 Answers

Open the Project Properties (right-click the project in Solution Explorer, select 'Properties'). Under 'Librarian', check 'Output File' - that's where the output should go.

If this looks right, try dir /s *.lib in a suitable subdirectory for your project, to see if you can locate the output library by date and time. If you still can't find it, try a clean rebuild (right click project, select 'Rebuild').

For DLLs, a .Lib file is not created if the DLL exports nothing for external usage. I don't think this applies for static lib builds but I would make sure you are exporting something public from your library project source code.

like image 70
Steve Townsend Avatar answered Sep 22 '22 05:09

Steve Townsend