Packing evrything into a static library


#1

hello

first, i have to tell that i’m a happy juce user (for some time now) and that i’ve never had any problem understanding the library usage (the doc is great , and this forum always helped me in case of doubt).

i have a simple question, to which i could not find the answer in the doc nor in the forum. i’m using juce methods for audio and midi files import into a data container. i want to compile a static library for this container , so that i can use a libmycontainer.a and libmycontainer.h for furhter developpements based on this container. this is an encapsulation that i’m achieing on the mac by creating a static lib, including all the header files and linking with the CoreAudio.Framework CoreMidi.Framework and all the necessary frameworks … and of course the libjuce.a file . the static lib generation goes OK, but i have then a problem when using it : i need to still link to CoreAudio.Framework CoreMidi.Framework , etc.

is there a way to get rid of this ? (i.e : build everything in a single static lib , that would not depend on external frameworks to be linked).

thanks in advance for your help
david

PS : oh yes i forgot to tell , i’m using the amalgamated juce version


#2

Hi,
If you are creating a static library, linking is never done, only the source code that you have written is compiled.
In case of static library linking is done in the application to which you will add the library, so there is no point in linking to “CoreAudio.Framework and CoreMidi.Framework” in the library project, they have to be added to the application project which uses your library.
If you want to avoid doing this then create a dylib

regards,
vishvesh


#3

thanks for answering my question. this is now very clear to me.


#4

[quote]
thanks for answering my question. this is now very clear to me.[/quote]
Nice no know that it was of some use :smiley: .