News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Building a library with Microsofts lib.exe

Started by dennosaurus, July 23, 2011, 05:41:26 AM

Previous topic - Next topic

dennosaurus

 :(I am attempting to build a static library using Microsoft's lib.exe in Code Blocks. Code Blocks insists on adding the link libraries and options to the lib.exe command, thus ruining my build. Lib.exe is not link.exe and none of the link libraries or options should appear in the lib.exe command. Lib.exe has it's own set of commands. Is there any way I can stop Code Blocks from doing this?

oBFusCATed

What is the type of the project? (Project -> Properties -> Build Targets -> Type)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

dennosaurus


dennosaurus

Type of project is Static Library. Build software is Microsoft 2010 x32.

dennosaurus

I have also created a Static Library target that uses Microsoft's VC6 build software. This uses link.exe to build the library and requires the link option -LIB. Code Blocks adds /LIB instead of -LIB, causing an error. It also is adding the global link libraries, library paths, and options to the command which it should not do.

zabzonk

The link.exe command, like all MS programs, uses slashes to indicate options, so /LIB is correct.

dennosaurus

The solution. I created a new compiler entry in Settings/ which is a copy of the compiler entry I was using and named it Library compiler. Then I removed the link libraries, link options, and linker paths from the Library compiler. By using this compiler in my target I get a reasonable lib.exe command. Lib.exe still complains about the /LIB option that Codeblocks adds but it builds correctly.