[Qt-interest] ATL in Qt...

Scott Aron Bloom Scott.Bloom at onshorecs.com
Mon Apr 26 18:09:49 CEST 2010


You will need to build Qt using the same compiler....

The version provided by Nokia is built with mingw...

Scott

-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of BRM
Sent: Monday, April 26, 2010 11:06 AM
To: qt-interest
Subject: Re: [Qt-interest] ATL in Qt...

----- Original Message ----

> From: "Malyushytsky, Alex" <alex at wai.com>
> To: qt-interest <qt-interest at trolltech.com>
> Sent: Fri, April 23, 2010 4:40:55 PM
> Subject: Re: [Qt-interest] ATL in Qt...
> 
> With lack of full information I will make few assumptions which according to my 
> impression are required for being able to link to static library:
> 1. The same Microsoft compiler was used to build: Qt, your project and static library.
>If not I am afraid you are out of lack.

Qt is the Windows version (4.5.2) released by Nokia.
The rest are all compiled under the same compiler - MSVS 2008 SP1+TR1

> 2. Static library you  mentioned is linked to the same version of CRT libraries.

Static library is configured using QMake. Yes I have the source; it is built as part of the project.
While it is just standard C/C++ its project file is a QMake project.
All the projects are converted to VC++ using:

qmake -tp vc <qmake project>

One set of projects is converted using:

qmake -tp vc -r <general qmake project>

> This mostly likely is false, cause static libraries are normally linked to static (single 
> threaded or multithreaded) CRT libraries and Qt, unless it was changed recently 
> does not support linking to static CRT on the Windows. You can try manually 
> set the appropriate compiler options and rebuild Qt and your project to link 
> against static CRTs, but at the time I tried it were introducing run-time 
> problem in Qt core. If you have access to the source code of the static 
> library you mention  it would be much easier to rebuild that static library to 
> use CRT you need. If you don't have access to it,  my impression that it 
> is a lost game and you better find a way not to link to that static library. All 
> you will need to do is to find all static library 
> dependencies.

I've tried setting a number of compiler options on the main project/solution but to no avail.
Namely: Changing to using static MFC, enabling ATL.

I can try the dynamic MFC/ATL too.

Ben

-----Original 
> Message-----
From: 
> href="mailto:qt-interest-bounces at trolltech.com">qt-interest-bounces at trolltech.com 
> [mailto:
> href="mailto:qt-interest-bounces at trolltech.com">qt-interest-bounces at trolltech.com] 
> On Behalf Of BRM
Sent: Friday, April 23, 2010 12:29 PM
To: 
> qt-interest
Subject: [Qt-interest] ATL in Qt...

I have a project that 
> is liking in a _static_ library (not a DLL) on Windows. The library itself is 
> mostly pure C/C++; however, it is ported from an MFC/ATL codebase and uses some 
> ATL classes - namely CPoint and CSize.
When I compile under Linux the 
> appropriate definitions are provided in module that is part of the library; 
> however, compiling under Windows is causing some problems as the definitions 
> interfere with the Windows definitions.

I've tried enabling the project 
> via its settings to use MFC and ATL as
static libraries; but did not have any 
> success.

I really only need to link some stuff in. Is there a trick to 
> doing this with 
> QMake?

TIA,

Ben

_______________________________________________
Qt-interest 
> mailing list

> href="mailto:Qt-interest at trolltech.com">Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger 
> Associates, Inc. made the following annotations.

“This message and any 
> attachments are solely for the intended recipient and may contain confidential 
> or privileged information. If you are not the intended recipient, any 
> disclosure, copying, use, or distribution of the information included in this 
> message and any attachments is prohibited. If you have received this 
> communication in error, please notify us by reply e-mail and immediately and 
> permanently delete this message and any attachments. Thank you.”

“Please 
> consider our environment before printing this 
> email.”

_______________________________________________
Qt-interest 
> mailing list

> href="mailto:Qt-interest at trolltech.com">Qt-interest at trolltech.com

> href="http://lists.trolltech.com/mailman/listinfo/qt-interest" target=_blank 
> >http://lists.trolltech.com/mailman/listinfo/qt-interest


_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list