[cfe-users] [libclang] module.map errors

Lucas Soltic lucas.soltic at orange.fr
Tue Jan 28 03:09:11 PST 2014


Hello,

I'm using libclang to parse source files, but as soon as the parsed source files include system headers, I get errors with module.map:
/usr/include/module.map:36:14: error: header 'float.h' not found
/usr/include/module.map:81:14: error: header 'stdarg.h' not found
/usr/include/module.map:113:14: error: header 'tgmath.h' not found
cl.c:2:10: fatal error: 'clang-c/Index.h' file not found

I linked against libclang 3.4 and I don't know what to do about this module.map error. I couldn't find any website dealing with this issue.
I'm running Mac OS X 10.9.

The sample program used to generate the error is as follow: (this is also the file parsed by this program)
#include <stdio.h>
#include <clang-c/Index.h>

int main(int argc, const char **argv)
{
	if (argc < 2) {
		printf("Usage: %s file\n", argv[0]);
		return 1;
	}
	
	CXIndex index = clang_createIndex(1, 1);
	
	if (index) {
		CXTranslationUnit tu = clang_createTranslationUnitFromSourceFile(index, argv[1], 0, NULL, 0, 0);

		if (!tu)
			perror("clang_createTranslationUnitFromSourceFile() failure");
		
		clang_disposeIndex(index);
	} else {
		perror("clang_createIndex() failure");
	}
	
	return 0;
}

Any pointer would be greatly appreciated :)
Lucas



More information about the cfe-users mailing list