Including a file in C++ doesn't work?

This is the path for the file: "C:\Users\user1\Downloads\pjproject-2.14\pjproject-2.14\pjlib-util\include\pjlib-util\xml.h"

I include the following path in Visual Studio 2022: "C:\Users\user1\Downloads\pjproject-2.14\pjproject-2.14\pjlib-util\include"

In the cpp file, this is referenced with the following line: "#include <pjlib-util/xml.h>"

I get the error: "cannot open source file "pjlib-util/xml.h" "

Is the error perhaps due to the use of slash instead of backslash, since it is Windows?

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
5 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
KarlRanseierIII
1 year ago

Look at the log how the compielr is called, so if the search path has been transferred accordingly. / vs. \ and the handling is sometimes compiler-specific, from that, yes that is potentially a possible problem.

NorbertWillhelm
1 year ago

Already attempts to include the relative path of the header file only in ” and ” instead of in < and > ?

Both at once do not work anyway.

FaTech
1 year ago

Did you download the code? I’m going out. Right click, properties and then possibly allow to press (a checkbox). Windows sometimes blocks files from the internet. By the way, I think you mean Visual Studio, not Visual Studio Code. Please don’t confuse, something can lead to confusion.

FaTech
1 year ago
Reply to  Novax454

Don’t worry, follow the steps I’ve mentioned. Maybe it helps