[Qt-interest] C Code with QMake

Jeffery MacEachern j.maceachern at gmail.com
Sun Aug 8 03:38:56 CEST 2010


On Sat, Aug 7, 2010 at 18:34, Thiago Macieira <thiago at kde.org> wrote:
> On Saturday 7. August 2010 22.06.45 Jeffery MacEachern wrote:
>> Part of the project I'm working on is a library written in C, which I
>> am building with QMake as I do the rest of the project, just for the
>> sake of simplicity.  I'm using an Arch Linux system with GCC.  QMake
>> compiles all of the C source files with gcc, but then links them
>> together using g++, unnecessarily pulling in libstdc++ as a dependency
>> in the process.  Is this something I'm doing wrong, or is it a bug?
>
> Neither. QMake doesn't know the difference. It simply assumes that linking must
> be done with the C++ linker.

Is it simply relying on the .c extension to determine that it should
use gcc for compiling the source, then?

> Try adding this to your .pro file:
>
> QMAKE_LINK = $$QMAKE_LINK_C

That works, thanks!
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>  Senior Product Manager - Nokia, Qt Development Frameworks
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> 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