<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - libClang Cannot Locate Header Files Of User Made Libraries And Projects"
href="https://llvm.org/bugs/show_bug.cgi?id=27393">27393</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>libClang Cannot Locate Header Files Of User Made Libraries And Projects
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>libclang
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nko12@comcast.net
</td>
</tr>
<tr>
<th>CC</th>
<td>klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Visual Studio 2015 Update 2
Windows 10 1511
libclang 3.8
I want to use clang to generate reflection metadata for use in some personal
projects that I'm working on. I am following this tutorial
(<a href="http://www.myopictopics.com/?p=368">http://www.myopictopics.com/?p=368</a>).
The tutorial has me creating a dummy file that includes all the header files I
would like to use to build up the AST. As a test, my current dummy file
includes two header files (using full, absolute path names), both of which
include header files of the following names:
#include <ConsoleMenu.h>
#include <vector>
#include <clang-c/Index.h>
Right now, my list of command line arguments looks like the following:
std::vector<std::string> args;
args.push_back(R"(-Wmicrosoft)");
args.push_back(R"(-Wunknown-pragmas)");
args.push_back(R"(-I C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\include)");
args.push_back(R"(-I C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\atlmfc\include)");
args.push_back(R"(-I C:\Program Files (x86)\Windows
Kits\10\Include\10.0.10240.0\ucrt)");
args.push_back(R"(-I C:\Program Files (x86)\Windows Kits\8.1\Include\um)");
args.push_back(R"(-I C:\Program Files (x86)\Windows
Kits\8.1\Include\shared)");
args.push_back(R"(-I C:\Program Files (x86)\Windows
Kits\8.1\Include\winrt)");
args.push_back(R"(-I D:\Libraries\ConsoleMenu\include)");
args.push_back(R"(-I C:\Program Files (x86)\LLVM\include)");
args.push_back(R"(-fms-compatibility-version=19.00)");
args.push_back(R"(-D _Debug=1)");
Notice the last two includes before the compatibility option. The first include
is to another project's include directory, and the second is to the LLVM
include directory. <ConsoleMenu.h> is located in the first include directory,
and <clang-c/Index.h> is located in the second.
Upon executing clang_parseTranslationUnit with this dummy file and the given
list of compilation arguments, I get the following single error
"fatal error: 'clang-c/Index.h' file not found"
If I move the libclang include statement into the source file that is using it,
I get the following error
"fatal error: 'ConsoleMenu.h' file not found"
Note, however, that finding the standard C++ vector header file was performed
without issue. Visual Studio's cl compiler fully compiles the code associated
with these header files without issue. All the include directories in the list
of arguments are what the cl compiler is using. Precompiled header file is not
being used.
This leads me to believe libclang can locate standard and system header files
from the search path, but not user defined header files.
Any suggestions? Chances are, I'm making some simple, obvious mistake here.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>