1

I have a static lib (mylib.a). How can I add it to the project (Momentic IDE)?

I treid to add it to lib folder and write

LIBS += -Bstatic -L/app/native/lib  -mylib -Bdynamic \

to the file .pro, but it doesn't work

Tim
  • 1,485
  • 2
  • 17
  • 31

2 Answers2

0

Right click on your project, select Configure -> Add Library from the menu.

On the dialog select External Library then Next. Browse to the locations for the device and simulator builds of the library, and add paths to the include directories. If it is a static library you may have to go into the bar-descriptor.xml file and remove asset entries for a dynamic library mylib.so. The reason for this is static libraries are linked at compile time, where as dynamic libraries that are not included with the OS must be loaded as assets with the application.

Richard
  • 8,950
  • 2
  • 16
  • 24
0

You need -*l*mylib. If that does not solve your problem, try to use absolute path for the static library.

lpapp
  • 47,035
  • 38
  • 95
  • 127
  • If you use the configuration menu in the IDE it makes the appropriate additions to the LIBS variable in the project .pro file. – Richard Apr 05 '14 at 14:13
  • @Richard: I am providing a solution which works outside the IDE, too, or in fact even in another IDE. – lpapp Apr 05 '14 at 14:14
  • Sure, but if you read his comment to my answer it is clear he has bigger proplems. The IDE doesn't recognize the file as a library which is probably an indication that it is not correctly formatted for BB10 development. – Richard Apr 05 '14 at 14:15
  • @Richard: I am answering the original question. – lpapp Apr 05 '14 at 14:19
  • In that case you should probably address path and library selection for at least the two main architectures that a BlackBerry developer will need to compile for: Intel x86 for the simulator and ARM for the device. – Richard Apr 05 '14 at 14:31
  • Actually, that is just the matter of device spec files, not the LIBS variable. – lpapp Apr 05 '14 at 14:35
  • Well you do need to have a library compiled for each architecture. – Richard Apr 05 '14 at 17:33