1

I am trying to port a 3rd party library to mediaplayerservice to enhance the support for many container formats.

I am able to build the 3rd party stack and get the library (static library) from it.

Now, I want to link this 3rd party library to the MediaPlayerService. I couldn't find out, where and how to mention in the makefile to link this static library.

I tried the adding the following lines,
LOCAL_STATIC_LIBRARIES := libThirdparty
&&

LOCAL_LDLIBS += -l$(TOP)/frameworks/out/target/product/tvsimvbox/obj/STATIC_LIBRARIES/libThirdparty_intermediates/libThirdparty.a

But, above lines are not helping. It gives the "undefined reference" error.

Chakkra
  • 337
  • 3
  • 10

1 Answers1

1

Able to link it.

You can use LOCAL_STATIC_LIBRARIES. The problem in my code is that the order in which I mentioned was wrong. Library which will use (required / dependant) library should be first and the library which provides should be next.

Otherway is that, LOCAL_LDFLAGS += -L"Path to the library" -lThirdparty

Chakkra
  • 337
  • 3
  • 10
  • If your objective is to link the library statically, then your comment should be fine. However, please do note that if your solution has to be scalable with every new `AOSP` distribution, then you should consider a dynamic linking. For example, you may be integrating a parser (just guessing) which needs to be included in future revisions also. The cost of managing the tree with static linking is higher compared to having a solution based on `dll`. – Ganesh Apr 24 '13 at 23:54