mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Question about gcc behaviour


From: Mark Brand
Subject: Re: [Mingw-cross-env-list] Question about gcc behaviour
Date: Sun, 25 Apr 2010 23:30:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.2pre) Gecko/20100308 SUSE/3.1b1-6.3 Thunderbird/3.1b1


On 04/25/2010 04:37 PM, Kārlis Repsons wrote:
This is somewhat offtopic, but isn't long, I want to confirm: when given
-lQtCore, g++ can either include it into the target application or it can link
target application to it depending on if it's libQtCore.a or libQtCore.so and
lib format is the only factor, which makes the difference?

I'm not sure if your question is specifically about building for MinGW. For MinGW, a file with the ".a" suffix could be a static library or the stub of a dynamically loaded (shared) library (DLL). Because Windows uses ".dll", the ".so" suffix is not used for MinGW.

For MinGW, "-lQtCore" will link to "libQtCore.a". For unix, the same flag links to "libQtCore.so" (dynamic) or "libQtCore.a" (static) depending on which is available and the "-static" flag.

It also useful to know that the Qt libraries have different names depending on whether they are static or shared. The static libraries follow the pattern of "libQtCore.a". The shared libraries follow the pattern of "libQtCore4.a", and require flags like "-lQtCore4". If you use qmake, the right "-l" flags will be in your generated makefiles.

regards,

Mark




reply via email to

[Prev in Thread] Current Thread [Next in Thread]