[Qt-interest] QTCreator + Addign static Windows Libraries

Benjamin Sonnemann b.sonnemann at gmail.com
Thu Apr 9 12:29:28 CEST 2009


Did you declare the protoype for building with
__declspec(dllexport) ?
like this:

test.h

#ifdef BUILD_LIB
#define DLLAPI __declspec(dllexport)
#else
#define DLLAPI __declspec(dllimport)
#endif

DLLAPI void Test();

And is both compiled as C++?

Benjamin Sonnemann


On Thu, Apr 9, 2009 at 12:13 PM, Parameshwari <paramr at tataelxsi.co.in>wrote:

>
> Hi Denton,
>
>        I have included the header file and in the .pro file i have included
> the .lib file like the below
>                                LIBS+= -lTest.lib in the QT project
>
> And some where in the forum i found that we have to add
> __declspec(dllimport) void Test(); outside of main. So I added that also
> And
> the error it is shoeing is below.
> error:" undefined reference to `_imp___Z9Testv'"
>
> Regards
>  Param
>
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com]On Behalf Of Denton Vis
> Sent: Thursday, April 09, 2009 2:55 PM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] QTCreator + Addign static Windows Libraries
>
>
> You have not told us what kind of error message you are getting. Without
> that, we cannot help you much.
>
> By the way, have you included the header which contains the definitions for
> the functions in the library, e.g. test.h?
>
> "Parameshwari" <paramr at tataelxsi.co.in> wrote in message
> news:019201c9b8f2$af348160$8519320a at telxsi.com...
> > Hi All,
> >          I wanted to add the static Library to the Qt creator.
> > For example:
> >
> > I have static Library named as "Test.lib" and it has a function
> definition
> > of "Test()".
> > Now , i want to invoke this function in Qt. how can i do this?.Please
> help
> > me out!!!!
> >
> > Thanks in advance.
> >
> >
> > Regards
> > param
> >
> >
> >
> > The information contained in this electronic message and any attachments
> > to this message are intended for the exclusive
> > use of the addressee(s) and may contain proprietary, confidential or
> > privileged information. If you are not the intended
> > recipient, you should not disseminate, distribute or copy this e-mail.
> > Please notify the sender immediately and destroy
> > all copies of this message and any attachments contained in it.
> >
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> The information contained in this electronic message and any attachments to
> this message are intended for the exclusive
> use of the addressee(s) and may contain proprietary, confidential or
> privileged information. If you are not the intended
>  recipient, you should not disseminate, distribute or copy this e-mail.
> Please notify the sender immediately and destroy
>  all copies of this message and any attachments contained in it.
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090409/0bf39fb9/attachment.html 


More information about the Qt-interest-old mailing list