GNU Compiler Collection: Difference between revisions

From David's Wiki
Line 3: Line 3:
[https://stackoverflow.com/questions/6578484/telling-gcc-directly-to-link-a-library-statically stackoverflow]
[https://stackoverflow.com/questions/6578484/telling-gcc-directly-to-link-a-library-statically stackoverflow]
* Use <code>-static</code>
* Use <code>-static</code>
* Use <code>-l:libblah.a</code> instead of <code>-llibblah</code>
* Use <code>-l:libblah.a</code> instead of <code>-lblah</code>

Revision as of 16:01, 26 March 2020

Usage

Static Linking

stackoverflow

  • Use -static
  • Use -l:libblah.a instead of -lblah