# QNetwork and CMake



## Newbie (Jun 21, 2017)

Hello,

New to obs and cmake, i'm trying to add QNetwork (to use QNetworkAccessManager and QNetworkReply) to create a window that is able to do a few requests on an REST Service.

I've tried to add the following on the CMakeLists.txt that is inside the UI folder:

...
add_definitions(${LIBCURL_DEFINITIONS})
*
find_package(Qt5 5.8.0 REQUIRED Network)
SET(QT_USE_QTNETWORK true)
INCLUDE_DIRECTORIES(${QT_QTNETWORK_INCLUDE_DIR})
*
....

target_link_libraries(obs
 libobs
 Qt5::Widgets
 obs-frontend-api
 ${FFMPEG_LIBRARIES}
 ${LIBCURL_LIBRARIES}
 ${obs_PLATFORM_LIBRARIES}
* ${QT_QTNETWORK_LIBRARY}*)

...

but not even the include is work #include <QNetworkAccessManager>  as it cannot find the file.

anyone did it before or knows how to do it? Thanks in advance.


----------



## Newbie (Jun 21, 2017)

And solved it, sorry for the newbie question! i switched the bold lines for
*....
find_package(Qt5Network REQUIRED)
...*
target_link_libraries(obs
 libobs
 Qt5::Widgets
 obs-frontend-api
 ${FFMPEG_LIBRARIES}
 ${LIBCURL_LIBRARIES}
 ${obs_PLATFORM_LIBRARIES}
* Qt5::Network*)


----------

