0

I use Visual Studio 2013 to build a program. I have got some problems... a) an error:

c:\users\wojciech\desktop\cryingdamson 0.3.6 (8.60) v8.2 source\otpch.h(28): fatal error C1083: Cannot open include file: 'libxml/xmlmemory.h': No such file or directory

My code:

#include <libxml/xmlmemory.h>

I have included that file in Visual Studio 2013 to header files and I have even it at libxml folder. I can not still build solution (compile) because of that error.

Please help me, I am new to Visual Studio. I have tried to add xmlmemory.h file to project properties, but it seems that it doesn't see the file.

Okay, in folder "c:\users\wojciech\my documents/visual studio 2013/projects/consoleapplication3" there is a file named MainProject.sln, which type is microsoft visual solution. In the same folder I have added libxml folder and in the folder I have put xmlmemory.h. The problem is I still can not compile the program.

I use windows 7.

pnuts
  • 58,317
  • 11
  • 87
  • 139
waqmaz93
  • 3
  • 6

2 Answers2

0

You Need to add the parent Folder of libxml to the include path. Say if the Folder structure Looks like

  • some_project
    • include
      • libxml
        • xmlmemory.h
  • ...

you Need to add the include Directory to the include path

Thomas Sparber
  • 2,827
  • 2
  • 18
  • 34
  • I just add this http://blog.gockelhut.com/2009/11/visual-studio-2010-property-sheets-and.html to your answer. op sounds like someone that should read a few lines about libraries/includes – Najzero Jul 15 '15 at 07:56
  • Okay, in folder "c:\users\wojciech\my documents/visual studio 2013/projects/consoleapplication3" there is a file named MainProject.sln, which type is microsoft visual solution. In the same folder I have added libxml folder and in the folder I have put xmlmemory.h. The problem is I still can not compile the program. – waqmaz93 Jul 15 '15 at 14:24
  • For external libraries I recommend adding the path to the library to the include path (in the Project Settings) – Thomas Sparber Jul 15 '15 at 14:38
0

Where is your xmlmemory.h? Of #include <.../libxml/xmlmemory.h> try a complete path in the ... part.

The path libxml/xmlmemory.h is in fact ./libxml/xmlmemory.h where ./ means the location of your workspace.

===============Next is added according to your comment==========================

Just using #include "..\libxml\xmlmemory.h" would compile. So your workspace path is therefore c:\users\wojciech\my documents/visual studio 2013/projects/consoleapplication3. Under your workspace there should be a folder MainProject where your existed source files are located. So .\ means the path c:\users\wojciech\my documents\visual studio 2013\projects\consoleapplication3\MainProject.

Note that you should use \ other than / to represent your file hierarchy in your project and that you should use "xxx.h" other than <xxx.h>.

You can also use this method: open VIEW->Property Manager, right click on MainProject and open Properties, in C/C++ -> General -> Additional Include Directories, add your folder libxml to it. Then all files under your libxml folder would become a part of your solution. You can just use #include "xmlmemory.h>" to make it compile.

Either way is supposed to compile.

Shindou
  • 506
  • 6
  • 15
  • Okay, in folder "c:\users\wojciech\my documents/visual studio 2013/projects/consoleapplication3" there is a file named MainProject.sln, which type is microsoft visual solution. In the same folder I have added libxml folder and in the folder I have put xmlmemory.h. The problem is I still can not compile the program. – waqmaz93 Jul 15 '15 at 14:24
  • @waqmaz93 I've revised my answer. Add your comment if there are still problems. – Shindou Jul 16 '15 at 01:54
  • First of all I want to thank You for the answer. It is cool that a foreign can do something for a foreign, so thank you so much! =) What can I do for You? But I have one more question. How to make it working using this "<" and this ">" instead of " " ". Thanks.. Best Regards! – waqmaz93 Jul 20 '15 at 20:16
  • Just use google.com, man. For your question, have a look at [#include Directive (C/C++)](https://msdn.microsoft.com/en-us/library/36k2cdd4.aspx) or [What is the difference between #include and #include “filename”?](http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename) – Shindou Jul 21 '15 at 00:41
  • @waqmaz93 If this do help you, please accept it as your answer. – Shindou Jul 21 '15 at 11:40
  • It doesn't help me. I do not know where and how to put a folder libxml to works it correctly using <>. – waqmaz93 Jul 22 '15 at 15:21
  • But that was not what your question ask! And for your 'one-more' question, please reference to my comment..the two links...you cannot...only files in standard library can use < >...files you yourself defined should always use " "... – Shindou Jul 23 '15 at 01:09