AFAIK static libs (.a files) are just simple file archives (thus the .a 
file extension) of .o files, basically several .o files appended to the 
same .a file. This means there's no linking taking place when creating a 
static library, and thus using another static library as dependency doesn't 
make much sense.

Only when build a DLL or executable, both libA.a and libB.a must be 
provided as linker inputs.

High-level build-systems like cmake somewhat obscure this (for instance in 
cmake it makes sense to provide one static library as dependency of another 
static library, but this only affects cmake's own dependency tree, for 
instance if libA is provided as cmake dependency of libB, only libB must be 
provided as dependency to executables and DLLs, and cmake will 
automatically add the libA dependency).

On Wednesday, 11 March 2020 12:03:19 UTC+1, anshul mahajan wrote:
>
> Hi All,
>
> I am trying to build my project using emcc but while building if I provide 
> staitc lib : libA.a ,  it it giving me error "Unknown format, not a static 
> library!'.
>
> In my case libA.a is dependent on libB.a. 
>
> building step for libB.a :
>
> 1) generating object file i.e .o files of all the cpp files
> 2) creating libB.a : running "emar" command for : emar -r {list of .o 
> files}
>
> building libA.a
> 1) generating object file i.e .o files of all the cpp files
> 2) creating libB.a : emcc -L ./ -llibB(dependent lib)  -o./libA.a {list of 
> .o files}
>
>
> My question here is : does anyone knows how to create static lib(.a) when 
> the static lib are dependent on other static lib.  i.e I have all the .o 
> files and .a file which I need to use for creating new lib. 
>
> Regards,
> Anshul
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/d7b0d469-e84d-4d2c-83ec-be4353d59a72%40googlegroups.com.

Reply via email to