Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The .lib (and .a also) works under two different capacities: </p> <ul> <li>As an import library for a shared Dll that your program depends on.</li> <li>As an archive library created from one or more object files compiled from source.</li> </ul> <p>You didn't really specify in your question which form you're working with. If you're looking to do the second form, you'll have to build the source under gcc as a static library as suggested by Persson since the library format used by msvc tools aren't compatible.</p> <p>However, there's some good news if you're working with the first form. The MinGW port of gcc should be able to work transparently with a coff-format import library created with msvc development tools. What you can do is simply rename the <code>*.lib</code> import into <code>lib*.a</code> and just pass that to the linker like it's any other <code>*.a</code> file. The linker should be able to sort out its real format. </p> <p>I've tested this under tdm-gcc-4.5.2 with the latest nightly build of codeblocks and it appears to work ok.</p> <p><strong>Edit:</strong> Merged my comment as part of the answer. If you're working with the second form and need to build a static library from source, the steps are roughly as follows:</p> <p>If there's an existing msvc project you can use it as a starting point by importing it into codeblocks. It'll be under <em>File->Import Project->Visual Studio</em> etc. </p> <p>If none is available making a new C::B project from scratch isn't too difficult. Just goto <em>File->New->Project</em> select '<em>Static Library</em>' as the project type then add whatever source file is needed. If the library is written in a semi-portable matter it should compile without too much trouble.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload