[Qt-creator] How make QTCreater project build for Windows or Linux?

Adam Higerd ahigerd at timeips.com
Fri Mar 20 22:49:47 CET 2009


Ed Sutton wrote:
> How can I make a single *.pro project that can be opened under either
> Linux or Windows and build a shared library/Dll that target that OS?
> Is there a Linux / Windows build setting or macro to define some
> place?
> 
> Thanks in advance for any direction,
> 
> -Ed


You don't need to do anything special. Qt does this automatically, with 
no need for special configuration.

Should you find yourself needing to specify custom code for one platform 
or the other, you can use something like:

win32 {
     QMAKE_STUFF = windows stuff
}
else {
     QMAKE_STUFF = non-windows stuff
}

in your .pro file, or you can use the macros like Q_OS_WIN and Q_OS_UNIX 
to do conditional compilation in your source code.

/s/ Adam



More information about the Qt-creator-old mailing list