[Qt-creator] How to include libraries in Qt

Krishna Achugatla krishnaa at symbian.org
Tue Feb 16 00:39:10 CET 2010


Hi,

Thanks for the suggestions. Finally I am able to create, link and use a DLL.

More details on the forum post

http://developer.symbian.org/forum/showthread.php?t=4989

<http://developer.symbian.org/forum/showthread.php?t=4989>-Krishna.

On 15 February 2010 00:59, Danny Price <deepblue842 at googlemail.com> wrote:

> Unless your dll is in the same directory, qmake probably won't find it -
> you need to include the full path, just as in MSVC.
>
> Creator will force you to become a qmake expert, trust me :)
>
>
> On Sat, Feb 13, 2010 at 1:22 AM, Krishna Achugatla <krishnaa at symbian.org>wrote:
>
>> Hi Mark, Thanks. Still no luck, here I am explaining in detail.
>>
>> Hi,
>>
>> My objective is to create a shared library and link it with app and call
>> some APIs of dll in the app.
>>
>> Platform Details:
>> -----------------------
>> Qt for Symbian 4.6.0
>> Qt Creator 1.3.0
>> S60 5th edition
>> Abld is build system
>>
>> Below are the steps followed and issued faced.
>>
>> 1. Creating "App"
>>    I created an app called "MyApp" using Qt-Creator "Qt4 Gui Application"
>> option. Default tool chain used to build is GCCE and able to build it.
>>
>> 2. Creating "Shared Library"
>>    I created a shared library called "MyDLL" using Qt-Creator option "C++
>> Library" then "Shared Library". Default tool chain is GCCE and able to built
>> it.
>>
>> 3. Link "Shared Library" with "App"
>>    I don't find any good documentation of how to do this, the whole
>> sequence of steps needed. I figured that LIBS needs.
>>
>>    Added below line to MyApp.pro file
>>    LIBS    += -lMyDLL.dll
>>
>>    as suggested by qmake help, then building the app gives error
>>
>> make[2]: *** No rule to make target
>> `\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\armv5\LIB\MyDLL.dso',
>> needed by
>> `\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\gcce\udeb\MyApp.exe'.
>> Stop.
>> make[1]: *** [TARGETMYAPP_0XE25A8EF2] Error 2
>>
>> Question is : I am working with tool chain GCCE, why make is looking into
>> ARMV5 path?. i.e.
>> `\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\armv5\LIB\MyDLL.dso
>>
>> 4. Trying to work with Tool chain ARMV5
>>    First, I want to build the MyDLL with Armv5. I created a new project
>> settings with tool chain as ARMV5, then build MyDLL. Following error occrued
>>
>>    Error: C0000U: Unrecognized option '--visibility_inlines_hidden'.
>> make[2]: ***
>> [\S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\Qt-Projects\DLL\MyDLL\MYDLL_0XE11197E8\ARMV5\udeb\mydll.o]
>> Error 1
>> make[1]: *** [TARGETMYDLL_0XE11197E8] Error 2
>>
>>   The generated MyDLL_0xE11197e8.mmp file has the line
>>   OPTION ARMCC --visibility_inlines_hidden --fpu softvfp
>>
>>
>> I feel, creating a library is a very basic thing and it should be very
>> easy for any body to do. There should be a single wiki page explaining all
>> the steps with code whereever possible.
>>
>> I feel we should have detailed docmentation for Static Library, Shared
>> Library and Plugins with code examples.
>>
>> Let me know if I miss any thing...
>>
>> -Krishna.
>>
>>
>> On 11 February 2010 22:40, Ladnar, Marc <Marc.Ladnar at ksab.kroschu.com>wrote:
>>
>>>  Hi Krishna,
>>>
>>> ther is no difference in binding your static or dynamic library into
>>> another app.
>>> You just have to put this line into your app.pro file:
>>> LIBS += -L[PATH_TO_YOUR_LIB] -l[LIB_NAME]
>>> If your lib is called libxy, you will have to add -lxy, so leave the part
>>> "lib".
>>> Static libs are directly included into the binary, dynamic libs have to
>>> be delivered with the app.
>>>
>>> Adding Plugins into your app needs the QPluginLoader, it is documented in
>>> QtAssistant. Plugins have to be delivered with the app, too.
>>>
>>> Hope I could help, have a nice day.
>>>
>>> Marc Ladnar
>>>
>>>  ------------------------------
>>>    *Von:* Krishna Achugatla [mailto:krishnaa at symbian.org]
>>> *Gesendet:* Freitag, 12. Februar 2010 00:24
>>> *An:* Qt-creator at trolltech.com
>>> *Betreff:* [Qt-creator] How to include libraries in Qt
>>>
>>>   Hi,
>>>
>>>  I have created a Qt SharedLibrary (e.g. MySharedLibrary) using
>>> Qt-Creator. I followed the navigation steps "File"->"New File or
>>> Project->Projects"->"C++ Library". Then choose the "Type" as "Shared
>>> Library", gave name and it created the Shared Library. The created shared
>>> lib has the necessary declarations and defines wrt Q_DECL_EXPORT. I wrote
>>> few functions in that class, so that they can be accessed in another
>>> application.
>>>
>>>  How do I include this Shared Library as part of another Qt
>>> Application?. What are the necessary changes required to make to .pro file
>>> (like adding LIBS variable) and source files of the app?. Please let me know
>>> any documentation is available. If the documentation explains with code, the
>>> necessary changes then it becomes very easy for developers.
>>>
>>>  Similarly it is good to have documentation about other two types of
>>> libraries, viz. "Statically linked library" & "Plugin", how to include them
>>> in an application with example code.
>>>
>>>  -Krishna.
>>>
>>>
>>> _______________________________________________
>>> Qt-creator mailing list
>>> Qt-creator at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>>
>>>
>>
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>
>>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20100215/71333c4d/attachment.html 


More information about the Qt-creator-old mailing list