Ahamed Rahil
Ahamed Rahil

Reputation: 39

QNetworkAccessManager issue using visual studio

AM trying to develop an application using qt and visual studio. In my application, I want to access network, but using QNetworkAccessManager I got an error like 'Cannot open include file: 'QNetworkAccessManager': No such file or directory'. How can i resolve this?

Upvotes: 2

Views: 334

Answers (2)

puerile
puerile

Reputation: 643

In Visual Studio 2022, after clicking on Extensions -> Qt VS Tools -> Qt Project Settings, Click on these when the menu dialog appears

In Visual Studio 2022, after clicking on Extensions -> Qt VS Tools -> Qt Project Settings, click on these when the menu dialog appears

Then click on Network

Then click on Network

Upvotes: 0

Zlatomir
Zlatomir

Reputation: 7034

QNetworkAccessManager is a class from network module of Qt, so in order for you to use that class you'll need to add it's headers to include path and link to the network module library.

To do that (for a Qt module) in Visual Studio:

  • open Qt VS tools menu
  • open Qt project settings,
  • in the dialog that appear you need to open Qt Modules tab
  • check the Network module checkbox and confirm with Ok

Upvotes: 3

Related Questions