14

Could you please explain, how linking with -l option against .la files works?

As far as my experience reaches - i have only linked against static library (.a) files.

Now i took a look at some Qt generated Makefiles and cant figure out, how linker figures out to use/open libQtCore.la file, when -l QtCore switch is specified, instead of looking for libQtCore.a.

Also - gcc manual states, that -l[library name] switch will include lib[library name].a, not lib[libraryname].la.

0xDEAD BEEF
  • 2,074
  • 7
  • 31
  • 46
  • I'm not familiar with the extension `.la`. What does `file yourfile.la` say? Maybe it's just the same as an object archive and can be renamed to `.a` – sellibitze Jun 18 '10 at 12:36

1 Answers1

16

.la files are as far as I know libtool junk and shouldn't be linked to manually. They are used internally by libtool for whatever reason it needs them. You should link to the *.a file. In a Qt install/build there should be *.a files to link to.

rubenvb
  • 74,642
  • 33
  • 187
  • 332