Ambiguous occurrence `unsafePerformIO'
It could refer to either `Foreign.GreenCard.unsafePerformIO',
imported from `Foreign.GreenCard' at dist/build/Clang/FFI.hs:171:1-24
(and originally defined in `Foreign')
imported from `System.IO.Unsafe' at dist/build/Clang/FFI.hs:176:25-39
(and originally defined in `GHC.IO')
Fixed in trunk, will release to Hackage soon
This looks like it's still broken on Hackage (LibClang-0.1.0). Building from the source at master, I get different, scarier errors. Are there any assumptions about the version(s) of llvm/clang/ghc needed to make this work? I'm building with ghc-7.4.2 and llvm-3.2.
Could you post the errors here? It would help.
At the current master (61f4a12) I get these warnings and errors from cabal build:
In file included from ./src/Clang/FFI_stub_ffi.h:7,
warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
src/Clang/FFI_stub_ffi.c: In function ‘prim_getCString’:
warning: assignment discards qualifiers from pointer target type
src/Clang/FFI_stub_ffi.c: In function ‘prim_getDiagnosticCategoryName’:
warning: ‘clang_getDiagnosticCategoryName’ is deprecated (declared at /usr/local/Cellar/llvm/3.2/include/clang-c/Index.h:862)
src/Clang/FFI_stub_ffi.c: In function ‘prim_translationUnit_CXXPrecompiledPreamble’:
error: ‘CXTranslationUnit_CXXPrecompiledPreamble’ undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
src/Clang/FFI_stub_ffi.c: In function ‘prim_translationUnit_NestedMacroExpansions’:
error: ‘CXTranslationUnit_NestedMacroExpansions’ undeclared (first use in this function)
src/Clang/FFI_stub_ffi.c: In function ‘prim_translationUnit_NestedMacroInstantiations’:
error: ‘CXTranslationUnit_NestedMacroInstantiations’ undeclared (first use in this function)
I guess I should also mention that I'm on OSX 10.7.5, in case that's a sticking point.
It looks like they removed CXTranslationUnit_NestedMacroExpansions, CXTranslationUnit_NestedMacroInstantiations and CXTranslationUnit_CXXPrecompiledPreamble flags from llvm 3.2. Either that, or you have a bad setup. I've tested LibClang uptil llvm 3.0.
It'll take atleast till the weekend for me to update my setup and test this, but you could try just deleting the entries causing errors from this line here and trying to recompile.
I finally got some time to update to llvm 3.2 and fixed the errors and cleaned up some tests.
I've however put this in the llvm3.2 branch, as I'm getting some string conversions being botched up and I'm currently unable to figure out why they're happening. The issue is in Test_ChildVisitor, some of the cursor names have the first four chars zeroed out.
Closing this issue, will continue this in a new issue.