0

I have written a small C program using portaudio and libsndfile which works only on my PC. In other systems it asks for libportaudio.dll and libsndfile.dll.I am linking with -lportaudio and -lsndfile.

I want to make this work everywhere(Windows) without asking for such things ?

What should i do to make this application (.exe) distributable ?

(I am using Code blocks and Mingw)

Thanks in advance.

Chaithra
  • 1,130
  • 3
  • 14
  • 22
  • libsndfile uses a LGPL licence I believe. You can't statically link LGPL code unless it has a static-link exception. PortAudio uses an MIT licence and you can (in theory) statically link it. – Ross Bencina Apr 18 '14 at 18:28

1 Answers1

0

Try passing -static to the compiler, to ask it to make the library references static, as opposed to dynamic. You can see if you've successfully made the binary statically linked by running nm on it.

Of course you must also make sure you don't violate any licenses by re-distributing the libraries in this fashion.

unwind
  • 391,730
  • 64
  • 469
  • 606
  • I tried that.. still not working... I even tried statically linking using -l portaudio.dll.a and -l libsndfile.dll.a and removed -lportaudio -lsndfile, then it gives undefined references to the functions used.. Can you please provide some example compilation schemes ? – Chaithra Apr 16 '14 at 03:36