Home >Backend Development >C++ >How Do I Add External Libraries to My Qt Creator Projects?
Adding External Libraries to Qt Creator Projects
Integrating external libraries into Qt Creator projects allows you to leverage preexisting functionality in your applications. For instance, the Windows function EnumProcesses() requires the inclusion of Psapi.lib in your project to function.
Solution:
The recommended method for adding external libraries in Qt Creator RC1 is:
LIBS += -L/path/to -lpsapi
In this command:
This method ensures compatibility across all platforms supported by Qt.
Incorporating Libraries from the Project Directory:
If your library files are contained within the project directory, you can reference them using the $$_PRO_FILE_PWD_ variable. For instance:
LIBS += -L"$$_PRO_FILE_PWD_/3rdparty/libs/" -lpsapi
This approach allows you to maintain the libraries alongside your project files for easy management.
The above is the detailed content of How Do I Add External Libraries to My Qt Creator Projects?. For more information, please follow other related articles on the PHP Chinese website!