How to figure out what #includes are needed?

This is partly an llvm question, and maybe partly C++.

I am trying to make calls on code in the llvm infrastructure.(3.4.2) I appear
to be missing some include files, but don't know how to track them down. I get
compile errors on existing llvm header files, like the following two examples:

This is partly an llvm question, and maybe partly C++.

I am trying to make calls on code in the llvm infrastructure.(3.4.2) I appear
to be missing some include files, but don't know how to track them down. I get
compile errors on existing llvm header files, like the following two examples:

Shouldn’t -std=c++11 be there also?

This is partly an llvm question, and maybe partly C++.

I am trying to make calls on code in the llvm infrastructure.(3.4.2) I appear
to be missing some include files, but don't know how to track them down. I get
compile errors on existing llvm header files, like the following two examples:

My recommendation is to look at the header files that define the classes and methods that you're using in LLVM. The easiest way to do this is to use doxygen.

For example, if I'm using the Function class, I look at the doxygen page at:

http://llvm.org/doxygen/classllvm_1_1Function.html

That page tells me that the class definition is in Function.h. I look for Function.h and (in LLVM 3.2) it exists in:

llvm/Function.h.

As you write more LLVM code, it becomes easier to find header files as you'll get more accustomed to the source code.

Regards,

John Criswell

Well, that introduces a new error:

This is partly an llvm question, and maybe partly C++.

I am trying to make calls on code in the llvm infrastructure.(3.4.2) I appear
to be missing some include files, but don't know how to track them down. I get
compile errors on existing llvm header files, like the following two examples:

My recommendation is to look at the header files that define the classes and methods that you're using in LLVM. The easiest way to do this is to use doxygen.

For example, if I'm using the Function class, I look at the doxygen page at:

http://llvm.org/doxygen/classllvm_1_1Function.html

That page tells me that the class definition is in Function.h. I look for Function.h and (in LLVM 3.2) it exists in:

llvm/Function.h.

As you write more LLVM code, it becomes easier to find header files as you'll get more accustomed to the source code.

Regards,

John Criswell

This process will help me in other situations, where I have a use of an undeclared
identifier and need to find the relevant declaration. In this case, nothing is
undeclared. Instead, something is wrong with the way the types are used.

The only identifiers involved in the conflicting type signatures are _Tp and _Nm,
both declared very nearby as typename template parameters.

The only reason for my theory that missing include files are involved is that this
entire transitive include path compiled without error when I built llvm. For example,
CBindingWrapping is included by lib/IR/Core.cpp, and I have a Core.o in my build directory
(and have linked an external project to it and executed calls on a couple of functions
therein.)

The problem code itself is in my locally installed c++ libraries, but again, it compiled before.

I do not know enough C++ to figure out how these two functions could be legal overloads in
one context and not in another. The last standard I had any familiarity with was 98.