c++ - how to add macro defines in Qt .pro file -


this question has answer here:

i using asio alone in project, supposed built shared library used others.

but got following error:

warning please define _win32_winnt or _win32_windows appropriately. 

my question is, can add macro definition .pro file avoid it.

can tell me how it, add

 #define pi 3.1415926 

to .pro file.

add following .pro file:

defines += "pi=\"3.1415926\"" 

in compile output see like

g++ -c -pipe -g -wall -w -d_reentrant -fpie -dpi="3.1415926" -dqt_gui_lib -dqt_core_lib -i../nobackup/qbuffertest -i. -i../nobackup/qt/5.4/gcc_64/include -i../nobackup/qt/5.4/gcc_64/include/qtgui -i../nobackup/qt/5.4/gcc_64/include/qtcore -i. -i../nobackup/qt/5.4/gcc_64/mkspecs/linux-g++ -o main.o ../nobackup/qbuffertest/main.cpp

now can access macro in c++ files:

qdebug() << pi; 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -