How to pass parameters to linker in qt .pro file?

You may want to use QMAKE_CXXFLAGS, but it only passes the arguments to g++ at the compiling stage(i.e., g++ -c …) not at the linking stage.

To pass arguments to the linker, you should use the QMAKE_LFLAGS variable in the .pro file such as

QMAKE_LFLAGS += -Wl,–enable-auto-import

This will add the linker argument “-Wl,–enable-auto-import” to the LFLAGS variable in Makefile.Debug

 

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply