(C++) Linking against a library in Qt Creator under Windows

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) Linking against a library in Qt Creator under Windows

 

Qt CreatorWindows

 

Qt Creator FAQ showing how to linking against a library in Qt Creator under Windows.

 

In the Qt Creator project file, add the following line, to link against the Boost.Regex library:

 


LIBS+=C:/Qt/2010.02.1/qt/lib/libboost_regex.lib

 

Note that this example assumes that the file C:/Qt/2010.02.1/qt/lib/libboost_regex.lib exists. You must link to a .lib file, not to a .a file.

 

If you have Dev-C++ installed, you might want to use:

 


win32:LIBS += C:/Dev-Cpp/lib/libboost_regex.lib

 

The Hello Boost program shows how to link against the Boost library Boost.Regex under both Ubuntu and Windows:

 


unix:LIBS += -L/usr/lib -lboost_regex win32:LIBS+=C:/Qt/2010.02.1/qt/lib/libboost_regex.lib