1

I encounter a problem using the windows visual studio "lib.exe". (in my case, located under C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin )

Actually, it seems I have too many objects to merge in that lib, which makes a very long command line... too long for Windows.

My command line looks like:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\lib.exe /NODEFAULTLIB /SUBSYSTEM:WINDOWS /out:mem/libxps.lib  mem/bmWrapper.obj mem/bmWrapperWinGdi.obj mem/bmWrapperInternal.obj  ... and lets say 200 arguments here

This gives the error:

command line is too long.

First, what is the proper way to create a .lib (static) on windows? I saw some ways with a def file from a dll (dynamic).

Second, if I'm on the right path, how to get around such an issue?

Sandburg
  • 757
  • 15
  • 28
  • 2
    You can put your command line [into a file](https://learn.microsoft.com/en-us/cpp/build/reference/running-lib?#lib-command-files), and run `lib @filename` – Igor Tandetnik Aug 14 '20 at 14:47
  • No way, I didn't know such a trick. THANKS ! Hey, put it as an answer, it's really cool. – Sandburg Aug 14 '20 at 14:57

0 Answers0